Gcode assistance required

Hi, machine is an ender 3 on an astrobox (brilliant combination, next job is silent board and bltouch).

I have found a wonderful print complete sensor on thingiverse, however I need help with one line of the gcode. For information the device I am trying to make work is here https://www.thingiverse.com/thing:4257609

I can’t make the x axis move to the other end of the printer, it seems to be determined to “home” as it were.

The existing code is here

G1 X0 Y$machine_depth$ F1000 ; Move Heat Bed to the front for easy print

The one I need to replace it with is here

G1 X{machine_width} Y{machine_depth} ;Present print and ding the bell

Can anyone help me translate it please for astroprint?

I did try

G1 X$machine_width$ Y$machine_depth$ F1000 ;Present print and ding the bell

but no luck

Also, what does the sync gcode with Creality button do?

Any help greatly appreciated. Thanks very much