Reference a single script for several different events?

Reference a single script for several different events?

Hi,
I have a script(Same script) that needs to run during several different circumstances (onload, on edit, on user input,etc..).
Right now I have that script in 4 different places to run when various actions take place.

Is it possible for me to write that script once, and reference it when each of these different events take place (onload, onedit, on userInput) ? 

I thought maybe a customFunction would do that, but when I wrote one, all it did was give me a button to press to execute the function. I need the function to run when different form events are triggered.

Please let me know if I'm not clear.

Thanks,
Mike