Two cheap and easy things to try:
1.Clean the throttle body.
2.Run some Seafoam through the system.
Do a search for P0506 and see what you come up with. That's P-zero-five-zero-six.
If you put in P-oh-five-zero-six, not as much will come up.
There's no IAC on these trucks, but anything that can affect the performance
of the air intake can contribute to this code. Buildup behind the throttle butterfly
can cause obvious rpm fluctuations, especially with the AC on.
How many miles on your truck? How's the maintenance?