Can you add in your own functions to the scripts?
Yes, you can add a function to your screen script. This means it is hidden from all other screens and only accessible to the screen object itself.
The format is
MyFunction : function (parms) { logic } ,
And it is invoked by
this.MyFunction(parms);
Put the function before the <SYSINFO> block. Note trailing comma.
Alternatively, you can add a function to UF_VFSY40_RTS,JS and then is accessible to all screen objects. By passing your "this" reference to the function, it can generically act on behalf your behalf. See User-Defined Script Functions.