The "Is VDU 1 in effect?" during the call to VDUCHR should be "Is VDU 21 in effect?" (not VDU 1!).
Or "Is VDU disabled by VDU 21?" to be clearer.