I can give you my quick list of things I've seen cause a ping, excluding what you've already checked: EGR or its control solenoid not sealing off engine vacuum (remember, there's the valve itself AND a control solenoid the computer uses to open it; I've replaced mine already), vacuum leaks, EGO(s) gone completely rich (doesn't always set a code!), TPS with a crapped-out resistive track (check with an analog VOM), a MAF sensor gone bad (would explain the bad idle problem, definitely worth looking into), bad fuel pressure regulator (although I have yet to see one cause a lean condition, it is *possible*), or low fuel pressure.
Armed with a VOM, fuel pressure tester, and open eyes, I think you'll nail this problem. Good luck!
------------------
Capri306, Moderator, The Mustang Works Online
1979 Mercury Capri, 5.0L -- C4 -- 2.73
1987 Mustang LX Notch