It is possible to encapsulate the functionality or procedures into separate JS files and reference them from the form. I often do this and have a list of standard JS files with specific functions as I need them. You can insert the file into your event by ading this block of code.
//Insert JS Functions to perform whatever functionality:
var script = document.createElement("script");
script.src = "http://crmserver:5555/ISV/JSFiles/CRMControlFunctions.js";
Don't forget to substitute your own server, port and filename. Ensure that it's hosted in a website or virtual directory and reachable from the CRMWeb website application.