for the Moment i can not see the real benefit of your script, because the
G0 X/Y25 moves are done in the actual fixture Offset (G54..).
let's say for example your G54 0,0 is in machine coords at 200,200 the machine
will go to 225/225 and do the ref X/Y.
faster would be to use G53 G0 X/Y25 then machine will go to 25mm from Limit Switches,
but this is dangerous if machine has not been homed before, because this 25,25 can be somewhere.
this are only my insignificant thoughts.