As part of the user interface automation, you can add something like
#import "MySharedFunctions.js"
at the top of your script so that it pulls the code from another JavaScript file. This can be used to store general testing or other helper functions in a common source file.
source share