Unless I am not following your changes right, It seems in your ISR you are still waiting while gpio.2 is high. since that is now an analog input (I think) it might just be zooming right through the ISR making it look as though it was never called.