You could try something like this, NOT tested so be careful
Put a copy of these lines where you think they are needed
M1001 (call macro to record current positions)
G00 Z(Move to save level)
G91 G28.1 X0 Y0 Z0
G00 G90 X#1000 Y#1001
G01 Z#1002 Fffff
continue with code
....
Macro M1001 to be stored as M1001.m1s in current profile macro folder
‘ Get Machine Positions and store into #vars
SetVar(1000,GetABSPosition(0))
SetVar(1001,GetABSPosition(1))
SetVar(1002,GetABSPosition(2))