Here is some info about the code you have:
P0507-IDLE SPEED PERFORMANCE HIGHER THAN EXCEPTED
Theory of Operation
The objective of the Idle Speed Rationality is to monitor the ability to achieve and maintain a steady idle condition. The monitor will judge the functionality of the idle speed control system by monitoring RPM during idle. If RPM does not come within a calibrated deadband of target idle speed, a timer is started. If the timer reaches its maximum threshold without any sign of the RPM trending towards control, a soft failure is generated.
With the engine idling in drive, the brake applied, engine run time above a minimum calibrated value, and no VSS, MAF/MAP, ECT, TPS, ETC, CKP Sensor, fuel system, or injector DTCs present.
Engine speed is 200 RPM or more above target idle speed for 30 seconds. Two Trip Fault. Three good trips to turn off the MIL.
AIR INDUCTION SYSTEM LEAKS
Inspect the Air Induction System for the following problems:
Leaks: Air Intake tube connection, Air Cleaner housing, etc.
PCV SYSTEM LEAKS
Inspect the PCV system for the following problems:
Leaks - cracked or damaged hoses or tubes, poor hose or tube connections, PCV valve stuck open, etc.
ENGINE VACUUM LEAKS
Start the engine.
Inspect the vehicle for external vacuum leaks.
Inspect the engine for internal leaks.
Inspect the throttle body for carbon build up, other restrictions, and a bent throttle plate using a straight edge.
While the vehicle is running, lightly tap on ETC Motor with your hand and listen for idle to raise.
If the idle increases:
Verify that there is good pin to terminal contact at the Throttle Body and the Powertrain Control Module connectors. If OK, replace the Throttle Body Assembly. Disconnect the Battery when replacing the Throttle Body Assembly. After installation is complete, use a scan tool and select the ETC RELEARN function.
POWERTRAIN CONTROL MODULE (PCM)
Using the wiring diagram/schematic as a guide, inspect the wiring and connectors between the Throttle Body and the Powertrain Control
Look for any chafed, pierced, pinched, or partially broken wires.
Look for broken, bent, pushed out or corroded terminals. Verify that there is good pin to terminal contact in the Throttle Body and
Powertrain Control Module connectors.
Refer to any Technical Service Bulletins that may apply.