I've got an '02, same engine. I have a similar problem, codes show the engine misfires on Cylinder 5 and 6 when idling, and it gets worse as the engine warms up. The engine had about 140K miles on it and the truck had been sitting for about decade.
I tried several things to solve the problem, including new wires, a coil pack, plugs, and a cam synchronizer update. I also replaced some O2, sensors, etc. None of this was a waste exactly because I am renewing the truck, but it didn't solve my problem.
I finally did a compression test, and and found low compression in Cylinder 5. A leak down test indicated that the problem is the exhaust valve. As I did more research, it seems to be a common problem with burned out valves on the 3.0 engines for 2002 at about 150K miles. I'm planning to replace the cylinder heads soon, but I need to set aside a few days to do it, and I keep getting wishy washy about trying to install headers at the same time.
Hopefully, this isn't the issue with your engine, but you may want to do a compression test before going much further.