I'm Toothless....i mean speachless. Thanks for the effort @Slashee_the_Cow.
Unfortunately, the script is not working yet for me. If i place it in the right folder it does not how up in "Extensions > Post Processing > Modify G-Code".
Attached the Error log
@ahoeben yeah i know its misconfigured, but i can not configure the offset on the printer itself as the value i type in resets itself every timer i restart the printer.
@GregValiant yes, thats what i meant with "Trying to save the offset on the printer does not change anything.". Normally i set the z offset on the printer, use the save button and next time i start the printer this value is available.