Dear Sir.
Thank you for your reply, and I learned something new today.
So, the GETVAR(2002) is a command you can exceute when running scripts in Mach3, fx. Toolchange scripts etc.
The parameter "2002" is the same as you use directly in the G-code runtime as the #2002 parameter.
Mach3 does not handle the tool lenght compensation within the #2002 / GETVAR(2002) parameter.
I made a small test and the behaviour is as follows:
1. My probe is precise 5mm above stock. This is also Z=0
2. My tool length offset is +3.00 mm
3. I probe the surface with G31 and the value of #2002 is precisly -2.00mm
So the machine moved a physical distance of Z-5mm but reported back to #2002 that it only moved Z-2.00mm

The missing 3mm is caused by the tool length offset.
Meaning running the full AL program with initial probe + milling routine, then the mill is 3mm above the stock.
The solution would be to:
Identify which tool number is current tool, find the corresponding tool length offset value in the tool table database.
Subtract that value from bi-linear interpolation, then it would work.
However I have no idea if this can even be done in the G-code runtime. I think there is a better chance of running it as a script instead.
Or as an alternative create a Tool length offset input in your program, but that also gets really complicated fast, as you would also need to know which tool number the user intended to use for each process: Engraving, multiple drillings, routing of holes, and finally the cut-out milling.
But we are getting way out in the deep end of the pool here.
I still think the program is Great ! And a low-pratical solution for me could be to ensure all my tool used with this program has same offset (Tool length = 0) for all tools.
-Bo-