Kinda sounds like the TFI module is flaking out. Should be attached to the distributor. Parts stores used to be able to test them, or at Least Autozone could. Been a few years since I had to though, my F-series trucks are new enough that Ford had already relocated them to a heat sink on the fender and I was going to do the mod in the tech pages on moving it from the distributor to the fender when I put my 88 back together. If you do get it tested, if it passes the first time, have them test it a few more times, often they have to get a little warm to fail the test (which is why it will work when the engine is cold)