The only time I know of where I couldn't go over 4000rpms is when a parameter was so far out of spec the PCM wouldn't allow the engine to be run above 4000rpm (it was cam timimg too far off in my case. Fixed it and it revved fine). I wonder if the backfire bent the throttle plate since your having trouble idling and stalling.