Looks like you still need to learn a bit more gcode ;) The Z-axis is moving 3 times, but it is never zeroed. The G92 E0 command at the bottom just zeros the extrusion distance, not the Z-axis. So I see no issues with the script you posted (which makes sense since it's the default S3D script). Of co...