The only thing you need is a Feature with a CustomAction Element.
ScriptSrc: This is the location of your script file.
Location: The control to render the reference to the script file. Works like a delegate control.
Sequence: When you need to add more scripts you can determine the sequence for loading.
When the Feature is activated the Script is automatically added to the ScriptLink control which is on de MasterPage by default.