leveling stops after filament change

I am using Ponterface to print to a Taz 3. Leveling works great for prints until I attempt to change filament. The z axis resumes from the last position but the leveling stops. The printing completes as normal but you can see, the print is in error from not being level. If the bed was perfectly level you probably would not notice that the leveling is not working. The filament change macro I use is:
M300 S300 P1000; beep
G91 ;Set Relative Mode
G1 E-5.000000 F500 ;Retract 5mm
G90 ;Set Absolute Mode
G1 X20 Y20 F9000 ;Move to hold position
G91 ;Set Relative Mode
G1 E-40 F500 ;Retract 40mm
M0 ;Idle Hold
G90 ;Set Absolute Mode
G1 F5000 ;Set speed limits
G28 X0 Y0 ;Home X Y
M82 ;Set extruder to Absolute Mode
G92 E0 ;Set Extruder to 0

After changing the filament I apply slight pressure to feed the new filament through then press the knob on the display to resume printing.
I use a leveling micro switch and I manually installed the changes in the software. The leveling works fine if I don’t go through the filament changing routine. Any help would be appreciated, Thanks