If you're code gets the current offsets and saves them, then it would change them each time it's run.
You might be able to define the offsets in the g-code, like #1 = x offset, #2 = Y, .... and call a macro to change the offsets before running the code. You wouldn't need to save them, as the code would set them each time. Not sure if this would work or not.