Hi,
I had a procedure that did just exactly that, which I used for some time on certain jobs. At that time my axes were out of square to the tune of 0.3mm per 100mm.
Using formula correction in Mach3 did not work because the correction is applied 'in a lump' at certain times and that in turn caused what amounts to an infinite acceleration
and therefore the machine would stall.
To counter this I wrote a script, note by this time I was using Mach4, so the script was in Lua to apply the correction. This was possible because the Gcode programs I was using were all
linear moves in X and Y, and my scheme would not have worked if there were any arc moves, namely g2 or g3 moves. Provided your Gcode includes no arc moves you could do as
you have proposed, although the extra layer of complexity becomes very tiresome and correcting the machine fault is still the best option.
The procedure was run the script over the Gcode program and the script would write a new 'corrected' Gcode program where the X and Y ordinates had been corrected a little to
accommodate that they were not square to each other, and then run the 'corrected' Gcode file as opposed to the raw file.
I have since built a new machine where the axes are square and no such correction is required.
Craig