My Truck died!

I had a similar problem with my 92 318 truck. It would shut off sometimes and other times it would shutter and almost shut off. I did the fuel pump swap and a few other things. I wound up be the the cam sensor or in this case the magnetic pick up in the distributor Replaced it and never had another problem.
What Roy said... My 3800 Pontiac did EXACTLY as you describe. An old fart said, "next time it dies, spray water on the cam sensor". Fired right back up. Changed out cam sensor, no issues. Was cheap too..