There is no way that that code can't work i have you. Just put it in a php file and save it as ________.php. Then create the template it calls and voila. I've used that method several times.
Btw if you need to call a custom template inside another template then make sure it is placed above the previous call. That's why when you look at the code you will see the main template (e.g. forumhome, showthread) will always be the last template called
Regards
- miSt