Very possible you have a failing distributor. Electronic sensor tends to go bad and requires replacement. New distributor will run around $290, but you can get a rebuild with your trade in for about $180. I had the sae problem with intermittednt operation and random failure. I don't recall RPM wacking out, but then I was not looking for that
Other possibility is the fuel pump or the fuel pump relay.