Mine was doing something similar until I found one of the plug wires wasn't properly seated into the distributor cap. It had been like that awhile and corrosion built up inside until it was basically running one cylinder short.
Could be a intermittent spark problem.


91 SR5 Xtra Cab, 298000km, 4" lift, 56" rear springs, 33-12.5R15 BFG Mud-Terran T/A KM2.....and an '85 axle still waiting to go in.