My suggestion is to put most of your javascript and include as a separate file. Then just have a small javascript section to set whatever variables you need. In other words, avoid putting js functions through the template engine. Also, look into changes for Geeklog 1.8 for a class for adding javascript to a page.
Text Formatted Code
<link ...>
<script> var myvar = '{value}'</script>