When you put a value into the SPINBOX, you must hit ENTER to lock it in... otherwise no change.
Also... the SPINBOX will not effect the TOUCHOFF screen... they are separate.
If you are attempting to set the Z-Axis G54 HOME to the new measurement... for example 20mm as shown in your code... then the command would be
#TEMP = [#<_hal[pyvcp.stock]> * [-1]]
G10 L20 Z #TEMP P1
When the command is executed... TEMP is calculated... so if you set the SPINBOX to 20... then TEMP would be -20.
When the routine executes G10 L20 Z #TEMP P1 it tells LinuxCNC that you are now 20mm lower then the ZERO (HOME) position.
The current location will then be set as 20mm above the surface.
Is that what you are attempting to do?
Jerry