Hmmmm....
Mine use to throw a check engine light and it would stay on for long periods of time while driving ( 10 mins to an hours on road trips ) It would also ping on uphill climbs under load and felt somewhat sluggish ( Terms all mechanics love )
Turns out my O2's were bad and maybe the Fuel Pressure Regulator. The Ford shop pulled the codes ( for $35.00 ) and told me everything's normal except for the Lean Engine code.
After I replaced the O2's and FPR it ran great. MPG picked up slitghly too.
Rod, How many miles on your truck? and have you replaced the O2's? They are good for about 45K miles on average. Also wonder if there might be some after effects of being submerged for an extended period of time.
Another thought, IS it surging when you start it up? Only when cold? or all the time? A bad O2 might cause that since the computer is trying to get the fuel mixture right.
I'm reaching here. May have an intake leak somewhere too, Good idea to check all the vacum hoses and make sure they are good.
Good Luck