We can edit the script in your favorite JavaScript editor using the context menu.
Right-click in the text field and choose Open in external editor. The editor is configured in the Window > Preferences > TDI preferences tab:
Configuration Editor Preferences window
Parent topic: JavaScript Enhancements