A script job allows us to call a specific bit of code whenever a specific event occurs within maya. The full list of all the event available within maya is available if you type the mel command
scriptJob -listEvents
For a complete list with descriptions of what each one is, look in the mel command documentation for scriptJob.