It is unlikely to have to adjust the code, as thousands of printers are running this code - so unless yours has a some totally unique problem then you should be able to make it work.
From your console:
- G28 Z
- M851 z-20
- M500 (store settings - not 100% sure this is needed.)
(Be careful at this point it it entirely possible to crash into the bed.)
- G28 Z
- Move down in 0.1mm increments. (I use the motion controls on octoprint, not sure of the gcode).
Once it just grips the paper then you need to adjust the z offset as needed.
New z offset is -20+current Z height
I.e. if Z height = 9.3 then z offset is 10.7
- M851 Z-10.7
M500 - store settings
- G0 Z0 finger on power button just in case, check height when done, it should be in the ballpark, you might need to fine adjust with first few prints.
Remove all other z offsets from slicer.