I’ve written a script that does what I think you’re looking for. I use it specifically for an Adobe script-sync app I’ve written for my artists that on first run register’s an event with Photoshop through the COM. While I don’t own this code, my employer does I’m not at liberty to share it. I can however I can point you in the right direction.
What I think you’re looking for are Notifiers, search it up in the Object Model Viewer. app.notifiers.add(eventName, eventFile, eventClass); should be what you want. You will want to do some validation upfront to ensure the user doesn’t already have the notifier setup and that you’re actually passing in proper events.
Here is a small snippet that I put together for you, to hopefully set you on the right path
function installNotifier(eventName, eventFile, eventClass)
{
var notiferValid = validateNotifer(eventName, eventFile, eventClass);
if(notiferValid && !notifierInstalled(eventName))
{
app.notifiers.add(eventName, eventFile, eventClass);
}
}
Basically when all is set and done you can run a simple script to manage the events. Depending on what you’re doing, this can be a startup script in Photoshop that will ensure users to always have the events you want.