dunno if flashcut is still alive but anyway, i made some gcode to find XYZ stock origin using a touchprobe #ProbeSize should be set in the variables menu to the diameter of the probe tip

bring the probe tip to within .5/.5/.5 of the edges to check for, set program to zero, run this gcode. it'll end up at 0,0,.2 , setting the tool length of the probe makes it effective 0, i thought about adding a tool change at the top to a preset tool for the probe in the library.

I7 is the probe line, change for your setup. i ran it about 30 times in a row and i was getting around .0001 or better repeat-ability, also i did notice that the FlashCut Relative XYZ DRO has a math error, if you reset it to 0,0,0 and then keep running and resetting the program original it'll drift over by around .0001 each run) strange stuff.

It searches Z down, X - to X+ then Y+ to Y-
(Switch to imperial)
G20
(Go to Program Z0)
G01Z0F5
(Go to Program X0Y0)
G01Y0X0F5
(search z for .5" at feed rate of 1) input line 7
G31 Z-.5 I7 S1 E0 F1
(Program.Z is ?)
(set Program Z to 0, with compensation)
G92 Z#ProbeSize/2
(Dwell .5 second)
G04 P.5
(Move to Program.Z.1 above part)
G01Z.1F5
(Move to Program.X-.3)
G01X-.3F5
(Move to Program.Z-.03 below part , maybe use ball size?)
G01Z-.03F1
(search X for .5" at feed rate of 1) input line 7
G31 X.5 I7 S1 E0 F1
(set Program X to 0, with compensation)
G92 X-#ProbeSize/2
(Dwell .5 second)
G04 P.5
(move away from part in X)
G01 X-.2F5
(Move to Program.Y.4, still below part in Z)
G01 Y.4F5
(move into part on X, z is below top)
G01 X.1F5
(search Y for -1" at feed rate of 1) input line 7
G31 Y-1 I7 S1 E0 F1
(set Program Y to 0, with compensation)
G92 Y#ProbeSize/2
(Dwell .5 second)
G04 P.5
(move above part)
G01Z.2F5
(move over corner)
G01X0Y0F5