I use phplib and it doesn't allow {literal} which is obviously a cool feature.
Anyway, how about keeping the function in a separate file and have this in your template
<script language="javascript">
doThis();
</script>
[CODE]
That way, if smarty is looking for {} it won't find any!
If later on you need to pass data you could have:[CODE]
<script language="javascript">
doThis('{VAR1}','{VAR2}');
</script>
[CODE]