All of the B20/B30 D-Jet throttle switches are the same, although there are early and late styles. The electrical connector needs to be flipped over if using the late style switch. It will go in either way, so check that the numbers printed on the wires correspond to the numbers cast into the TPS.
To adjust the TPS, first make sure the throttle stop is properly adjusted. First loosen the TPS adjusting screws and the lock nut on the throttle stop adjusting screw. Back off the adjusting screw until the throttle plate is fully closed, then turn the stop screw in ? to 1/3 turn past contact with the arm on the throttle shaft and secure the lock nut.
Disconnect the coil so as not to burn the points and turn the key to the run position. Set the TPS in the middle of it's adjustment and snug one of the screws. Open the throttle until you hear a click, then let it close. You should hear a click when the throttle closes. If not, loosen the adjusting screw and turn the switch until you get a forward and back click with the least amount of movement of the throttle.
Once this is accomplished, the switch is adjusted but you still need to make sure it has 20 forward clicks with no glitches. Open the throttle slowly, counting each click without going backwards. If you don't get 20 clicks, or there are glitches, you need to remove the cover and carefully clean the PC board with a pencil eraser.