Ford F-150 runs rough

The vehicle is a 1986 Ford F-150 Pickup with a 5.0 L engine. It has about 72,000 miles. The truck will start up and run fine, but after a trip of about 35 miles, and then letting the truck set for 1 to 2 hours, when it is started up again, it really runs rought for several minutes. The fuel pump relays chatters during this time. The relay has been replaced. The EEC has once produced a ‘22’ code, which is the M.A.P. sensor. It was replaced, but the same problem is still occurring.

Did you disconnect the Battery when you replaced the sensor? The computer has to reset so it will recognize the new one

When the fuel pump relay chatters, what does it say? What could cause that?
The EEC (engine computer) controls the fuel pump relay. The EEC needs the “reference pulses from the electronic ignition system” in order to energize the f/p relay.
There may be a duty cycle strategy in the EEC when powering the f/p relay to control how long the fuel pump runs. Duty cycle reduces the work load on the fuel pump. Check the pulses from the ignition module to the EEC to see if there are too many interruptions in that signal.
From the f/p relay, power goes through the inertia shutoff switch, and, then, to the fuel pump. The inertia switch is in the trunk. Disconnect the wires from the inertia switch, jumper the wires, to by-pass the inertia switch, run the truck until the engine gets hot. Does the f/p relay still chatter? Anything to communicate?