Don't know if it is the correct way or the wrong but It worked.
Here how I did it.
Added literal at the below of the cms.tpl
{if $cms->id==3}
{literal}
<script type="text/javascript" src="mycustom.js"></script>
{/literal}
{/if}
then put the mycustom.js file in the directory /themes/mytheme/js/autoload
I am on 1.6