there's a slight bug in your script editing code that wipes the code if escape is pressed.
In the main loop change the RMB action to:
In the main loop change the RMB action to:
For n=1 To CountString(objectdef(activetile2+1)\trigger,"|") trigger$=parse(objectdef(activetile2+1)\trigger,"|",n) newdef$ = InputBox("New Script for trigger: '"+trigger+"'. ESC or RETURN to end",20,20,500,300,True,objectdef(activetile2+1)\script[n]) If Len(newDef) > 0 Then objectdef(activetile2+1)\script[n] = newdef$ Next