Update template.php

for using script
$this->template->script("alert('Hallo')", FALSE);
will generated script before </head>

$this->template->script("alert('Hallo')", TRUE);
will generated script on bottom of footer