Since this is in the 4.0 sub, I assume this is on a 4.0.... let me ask for a little clarification on first post, you are getting 10 full seconds of dieselling (running on after ignition is cut) on an EFI 4.0?
I had heard that dieselling was basically a carb only problem and came from an incorrectly setup carb (generally too rich, too high idle).... but I guess the other causes would still apply, wrong octane gas (too low), too much timing added, etc...
Now the wrong octane gas would explain both knocking and dieselling w/ more knock especially if the idle is set too high. just clarify, are we talking EFI here and you are getting 10 real seconds of run after ignition cut not just a second or maybe 1.5....?