Yes, there are some places you could put the code where it would not work. I'd recommend placing it right below this code:
PHP Code:
eval("\$footer = \"".gettemplate('footer')."\";");
Then if you look about 20 lines above that, you'll see a $templatesused section. You should be sure to add the name of your new template to that section as well to avoid having an unnecessary query on those pages.