When developing a custom feature, you can register your script(s) from code like this:
+ Page.ResolveUrl("~/ClientScript/pathtoyourscript.js") + "\" ></script>");
For initialization scripts that you want to load at the bottom of the page you can do it like this:
string initScript = "alert('hello world');"
+ initScript + "</script>");