I think
mc.mcCntlGcodeExecuteWait(inst, "G28.1 A0\nG53 G1 F75.0 A%4.4f\nG53 A-2.0000", (tpos + 12))
should be
formating strings in lua:
local s=string.format( "G28.1 A0\nG53 G1 F75.0 A%4.4f\nG53 A-2.0000", (tpos + 12))
mc.mcCntlGcodeExecuteWait(inst,s)
HTH
RT