I have had my old bronco 2 2.9l and my 94 2.3l do this very thing.
On the bronco, the cap, wires and plugs needed changed as the points on them or whatever you call them were corroded and all green.
On the 94 2.3 the dam wires were corroded where they snap onto the plugs and the
point of the coil pack where the wire plugs in was corroded and green
No clue as to why it did it but both times I used silicone on them to prevent it from happening again, never has.
Both times also, I could start the vehicle cold and all would run well but if I shut it down for alittle while and it was still even the tiniest bit warm when I restarted it it missed like a son of a gun. I rode home from cleveland oh in my bronco and let me tell you it was a bronco that day bucked like a sob all the way home.
My 94 2.3 which is in my Ranger, it recently started acting up under similar circumstances but happened more when the engine was cold, or if it was damp outside. Needed a new air filter as my dumb a$$ never thought to change it after takign it mudding 7 or 8 times,and it was in the water for about an hour towing out a f-150.
2 things are crucial to the computerized work of arts these days, 1.air...needs to be able to breath well.
2. Good connections, wether it be ground connections, spark plug wires or whatever the computers are very touchy it seems and with all the sensors that work on small voltages, it is imperative that they have good clean connections. Will save you alot of time troubleshooting in the long run.