Starting and idling problems

I think you will need to figure out if it's losing fuel pressure, or spark. Ima thinking it's fuel, so I'd be putting a pressure gauge on it.
It kinda sounds like the pump loses electrical power in the run position.