Not sure if this has anything to do with it, but at about the time the A axis starts moving, the code has lower case or small letter z in it as apposed to an upper case Z.
Line 224, then again at 230, which is when the A axis starts to move.
I'm no expert in reading or creating code so I don't know what effect that has on axis movement.