Okay. I guess you should probably retrieve the codes. It's possible that you may have a bad wire going into the MAF sensor and when you moved it to remove it from the air box it was able to make a propper connection again. You may want to try wiggling the MAF sensor wires while idling to see if it quits on you. You may also have a fault MAF sensor itself that comes alive when you wiggle it.
------------------
351W 89 Mustang GT Convertible