Check Jonathan's suggestion.

If you look at the code, there are jumps in the Z.
It starts of with relatively small steps around 0.05 rising to about 0.2, however there are 3 distinct jumps.
Line 110-115 Z moves 0.597, 225-230 it moves 1 and 340-345 it moves 1.965. I know those big moves also correspond with big steps in X and Y, but it does mean the code is a bit inconsistent, and may cause havoc with the projectory planner.