There's lots of examples of how to hook into filters and actions. You write your function, then reference it using add_filter() or add_action(). You'll need to look at the code that initiates the filter or action (using do_action() or apply_filters()) to determine what info is passed to your function. You hook function must return the first parameter, altered or not.
I implied in my previous post that 'transition_post_status' was a filter, but it is actually an action. Anyway, all your code can be placed in either a plugin, your theme, or a child theme. There's info on creating plugins and child themes in the Codex, it can be fairly simple.
The advantage of plugin or child theme is your code is preserved anytime there's an update of WP or your theme. Certain things can only be done in plugins, other things only in themes or child themes. For changing header tags, you can go either way.
In general, this is a good learning project. It'll take a while to figure everything out, but in the end, you'll find it's relatively straight forward. Your biggest problem may be in figuring out which combination of old and new status transitions exist, and which ones you need to address, and which to pass thru unaltered.
Learning some PHP and WP hacking skills will be well worth the time investment IMO. Good luck and have fun!