make sure you installed the TPS sensor correctly, if you didnt, then the ECU does not know how much fuel to give your motor at the correct Throttle Positions, Ill bet that this is your problem, one time i did a swap, on a 4th gen DX, and i forgot to switch the two outer wires on the TPS sensor, and the ecu thought the car was at WOT when it was Idleing and idleing when it was at WOT, at around 3500 RPMs, it would just about stall and then it would lunge out of it, just make sure your TPS is installed Correctly, then get back to us.
Gary