After spending quite a bit of time wondering what I was doing wrong, and changing values over and over again, I noticed that G90 would have my Z axis go down while G91 only let it go up, even when the called for Z command was up. I don't know what the difference is between G90 and G91, but when I changed the two downward probing commands to G90, and everything that is supposed to be Z up left at G91 the script started working properly for me. I imagine it's completely my fault I had to do this. Probably something to do with my Z axis motor mounted upside down and being pulley driven, and axis reversed when mapped.. Anyway, got it working, finally!