Here's an example of how I do it. Not sure what issues your code is having.
PHP Code:
/* If you want to edit the template yourself, by default this latches on to threadbit on <div class="threaddetailicons">
and adds the contents of the threadbit_stafftracker template right after it. */
$threadbitsearch = '<div class="threaddetailicons">';
if (isset($vbulletin->templatecache['threadbit'])) {
$vbulletin->templatecache['threadbit'] = str_replace($threadbitsearch, $threadbitsearch . vB_Template::fetch_template_raw('threadbit_stafftracker'), $vbulletin->templatecache['threadbit']);
}
Essentially, call your template using vB_Template::fetch_template_raw('templatename') - that way it pulls the raw code needed to be eval'd at the end. If you do it that way, it shouldn't fail. Good luck.