You might try using the WordPress Widget Plugin but that could require ‘widgetizing’ your Theme.
In the Codex article, WordPress Widgets, there is a Resources section that has links to the widget download and information on making your theme wigdet capable. There’s also a list of Themes that are already widget capable as well as a list of Widgets.
You can generally edit sidebar.php in your theme folder. Or, install widgets as MichaelH suggested. If you install widgets, you can add a text widget (already available with the basic install) and put your javascript in there. It’s that easy.