Yup. It depends on the script itself, and sometimes on server settings apparently (which is stupid, but the only thing I could figure out when it worked one way on one server and another way elsewhere - may have something to do with tweaks to apache modules, or the dif between apache and windows servers, though I don't have windows servers at all....)
This is what I've had luck with (within wp):
<script type="text/javascript">
//<![CDATA[
<!--
your script code goes here
// -->
//]]>
</script>
I don't think the {literal}{/literal} tagset will be of any help; then again, if you still have problems and want to try that, here's what works within templating engine pages (which are not wp):
<script type="text/javascript">
//<![CDATA[
{literal}
<!--
your script code goes here
// -->
{/literal}
//]]>
</script>
One other thing to note: sometimes a bork in a js call (in wp I'm talking about) will happen because the lack of white-space interferes somehow with the parser. Try giving each element its own line.... similar to how I have it shown above.