My V6 SOHC did that a long while ago, especially on humid days. Sometimes the truck would die and other times it would suddenly accelerate when my foot was off the gas pedal and cruising at low speeds... once almost causing a collision with a cop car that was fueling up at a gas station, lol! (it looked retarded, but the Ex really behaved like Christine the possessed Caddy at times and seemed to floor the gas pedal by itself at the worst of times: parking lots, red lights, gas stations, etc... but the problem was intermittent and impossible to replicate on purpose. Try to explain THAT to a judge!)
Anyway, I did the spark plugs & spark plug wires, new air / fuel filters tune-up and MAF sensor cleaning tune-up, but it would still do it, albeit now it would do it somewhat "less". So, after reading posts on a few different forums, I went to the Ford dealer and dished out $100 for a new
Idle Air Control (IAC) valve. Very easy to change (+- 5 minutes of actual work) and it seemed to cure the "possession" for good. The valve lasted approx. 9 years now and just recently I have ordered a new one from RockAuto (a "Delphi" made unit for about $50) because I have had some of the same symptoms return - namely, the truck dying a few times when I'd put it in gear and the weather was humid this winter. Warning: if you happen to buy a Delphi valve, make sure to reuse the old gasket or to cut out the new one with an exacto knife to match the valve's air holes, because the new gasket provided by Delphi (gray cardboard-like material) has air holes so small that it literally chokes out your engine in idle. Typical GM quality, lol! (I had to put the old Ford gasket back in there and send the Delphi gasket to the trash bin)
While reading up on the subject, I have learned that apparently the IAC valves get "lazy" over time and don't deliver the required air to the motor (slow response). I can attest to the fact that it must be true, as most of the hesitation and engine dying when putting the truck in gear (plus the possessed sudden acceleration) went away with a new IAC valve... twice.
Good luck!