Various options:
The palette has a script component you can drop on your page. It will point to an external file (usually put it in your resources directory)
Option 2:
Manually embed the script in your page by firing up the jsp editor and typing it in between a <Script> and </Script> tag. This is what i'm using at the moment as my scripts are specific to a single page.
Caution you may run into trouble using the second method with some javascript syntax (The && operator springs to mind) The work around for this is to use a CDATA[ section. It's been discussed here before... use the search facility (or have a look at the script for a table and duplicate that approach)