To answer the question asked in your comment on my previous answer...How to run the category modification function when a user activates your theme?
You'll want to use an action hook. Specifically, 'switch_theme'. This is the codex page for all action hooks, I can't link to switch_theme specifically, but scroll down and you'll find it. There is no specific information on this hook, but usage is simple. You can include your function in functions.php or in a plugin file, and after the function definition, include this hook:
function add_my_categories($my-theme-name){
//if $my-theme-name == 'my_theme_name
//test if category exists
//if exists, update
//if doesn't exist, create and assign parent
}
add_action('switch_theme','add_my_categories');
the 'add_action()' call will run the named function when the named hook is encountered in wordpress. The 'switch_theme' hook runs after a theme is changed.
It's important to know that this hook will provide the name of the new current theme to your function, which can accept it as an argument if you need it. For instance, to make sure the function only runs if your theme is the one activated. I suppose if this function is in your theme's functions.php file, it will NEVER run unless your theme is activated, so you can determine if you need to double check the theme name.