No, you should design your main javascript so that you pass in the ids for elements, and then use a smaller script rendered in the control to invoke your main script. So your main script can be external but it can't have any dependencies on things in your page or control, you have to pass that stuff in.
like jquery ui widgets are implemented in external files, then you only need a small script in the control to wire up a jquery widget using a selector with ids from your control.
Hope that helps,
Joe