To commit an event script on a router with two Routing Engines, ensure that you load the script file on both Routing Engines. A quick way to do this is to use the operational command file copy. For example, if you are on Routing Engine 0 and you copied the script.slax file (throuhg SCP or FTP) into the var/db/scripts/event directory, run the following command:
>file copy /var/db/scripts/event/script.slax re1:/var/db/scripts/event/script.slax
Now you should be able to commit the script.
Remember to repeat the process whenever you change the code; otherwise, after a mastership change you would run an old version of the script!