You can look at the compiled template in the database: the problem is that it starts like this:
Code:
$final_rendered = '<div class="above_body">
So that wipes out anything you add to the $final_rendered variable before that. So try this instead:
Code:
$replace = '$final_rendered = \'' . addcslashes($login_panel.$login_panel_css.$login_panel_javascript, "'\\") . '\' . ';
$vbulletin->templatecache['header'] = substr_replace($vbulletin->templatecache['header'], $replace, 0, 17);