I had a very simialr problem with my 1993 XLT a few years ago, I think it actually occurred in 1998-99. The engine would rev up very high, but only after I let it idle and the engine got up to normal operating temp. At first it only occurred after idling for several minutes such as when you were at a restaurant drive thru or a bank. I took the vehicle to Rockwall Ford in Rockwall, TX and they replaced the Mass Air Flow sensor. The problem still existed and got worse. I made several trips to the service department with no success. No one in the service department could ever get the vehicle to experience the same problem. Once, when the engine was revving up and the service department was closed, I took one of the salemen for a test drive, not only did the engine rev up, it began bucking violently. We made it back to the dealership and turned it off. At last I had a witness from the dealership! The service department had the vehicle for several days and went over everything. They finally found a short. That is all they said, just a short. I usually ask to see exactly what was fixed but didn't this time. BIG MISTAKE!!!!! The revving and bucking problem was caused by a postive battery cable that had a worn spot on it. The cable was shorting out and causing the problem. How did I find this out? Approximately one year later, my Explorer would not start. I popped the hood and found that the smaller wire on the positive battery cable had broken. I held the wire to the battery while a nice passer-by started the engine for me. I drove home and began removing the battery cable to replace it. That is when I found the $350.00 repair Rockwall Ford made to my Explorer that indeed fixed the revving problem - about 12 inches of electrical tape!!
I went back to Rockwall Ford and demanded a new battery cable, they said no. I then wanted my money back for the original repair, they said no, they had fixed the problem. I went as far as contacting Ford Customer Service. They were an inch away from refunding me the entire $350.00 dollars until they asked how many miles I had on the vehicle. Since it was over 100,000, they didn't want to do anything, end of discussion. I thought it would have been reasonable for Rockwall Ford to give me a new battery cable, which they should have done instead of using electrical tape. I ended up buying a new cable from them to the tune of another $45.
I am happy to say I still own the Ford Explorer and it has over 163,000 miles on it. I keep my vehicles until they die.
I know this was long, but this is the first time I have ever related this story in a public forum.
My advise to you - check that battery cable before you do anything else. Mine was rubbed bare by the air intake housing that goes from the air filter over to the plenum. After replacing the cable, I slit a piece of 3/4 inch heater hose and put it around the battery cable to protect it in the future.
I have never experienced the problem again.
Hope this helps you.
BTW - I still like my Explorer