If your trouble code is only the P0507, here is a step by step that must be done to resolve it (the manual way):
There are two ways to force a “relearn” procedure to get the PCM back to a good setting for the throttle plate. One involves a genuine Nissan Consult II scan tool, which most independent repair shops do not have. The other is a manual procedure.
Here’s how the manual procedure works. It’s a multi-step process.
First, perform an accelerator pedal released position learn procedure.
With the accelerator pedal fully released, turn the key to the ON position and wait at least two seconds. Then turn the key off and wait 10 seconds. Turn the key back to ON and wait at least two seconds. Then turn the key off and wait 10 seconds.
Next, perform the throttle valve closed position learning procedure.
With the accelerator pedal fully released, turn the key to ON than off. Wait 10 seconds. Listen for the sound of the throttle motor to verify that the throttle plate is moving.
Then you have to perform the idle air volume learning procedure.
The charging system must be in working order. To check, start the engine and use a digital multimeter to test the voltage at the battery. Drive the vehicle at least 15 minutes to warm up the engine and transmission to fully warm. With the engine running, battery voltage must be at least 12.9 volts. The transmission must be in park or neutral. All electrical accessories must be turned OFF. Center the steering wheel and make sure the wheels are pointing straight ahead.
If the idle speed is high, turn off the engine and disconnect two fuel injectors to bring the idle speed down. The PCM cannot relearn if the idle speed is too high.
Have a watch with a sweep second hand or a stop watch for the next steps. The timing MUST BE EXACT.
With the accelerator pedal fully released, turn the key to ON for exactly 3 seconds. Then fully depress the accelerator pedal and fully release it five times within 5 seconds. Wait exactly 7 seconds and fully depress the accelerator pedal and KEEP it depressed. After about 10 seconds the Check Engine light will start blinking. If it does not start blinking after waiting 20 seconds, turn the key OFF and wait at least 10 seconds. Then repeat the procedure from the very start. You may have to repeat this beginning procedure a few times until you get the Check Engine light to start blinking.
Once the Check Engine light starts blinking, let it continue to blink until it comes on steady. That usually takes another 10 seconds. Once it stays on steady, you must fully release the accelerator pedal within 3 seconds and start the engine. Let the engine idle. The relearn actually starts once the engine is running. The proceeding steps were just to prepare the PCM for the relearn procedure.
Let the engine idle for 20 seconds. If the relearn was successful, the RPM will drop. Turn off the engine and reconnect the fuel injectors you disconnected earlier. Then restart the engine to see if idle is normal.
From what I understand about what you've said, you've done the first step but not the second, correct? Both steps must be done after replacing those parts. This is something that can be done far more easily by the dealer, but the manual procedure saves you dollars. Beyond this stuff (the Idle Air Relearn procedure is tough to get down, and may not work the first couple tries), I'm not sure how to further proceed.