The stock "death flash" wouldn't cause pinging/spark knock, its designed to prevent it.
How did you retard the timing? Only way to do it on these trucks is with a tuner, you can't manually adjust it like you could on the older vehicles. Turning the distributor or whatever you may have done is bad, causes issues. Undo it.
The stock computer's "death flash" (do a search) retards the timing to far as it is anyway.
After you changed the plenum, did you reset the computer (disconnect the battery, turn on the headlights for a few seconds, turn off the headlights, reconnect the battery)?
Have you checked fuel pressure at the rails? Tested the injectors? Any upgrades to your truck? How long since your last tune-up? (What plugs, wires do you use?)