dang, that happened to my mom's car and my car when I changed the water pumps on ours, hers a 94 mine a 92. It turned out on her I forgot to plug the MAF sensor back in(I know, dumb) but it ran almost exactly the same and also I had put the passenger side rotor on backwards. So maybe you should check those but since you said it ran good for a while it might not be. My car the 92 what had caused the rpm signal 2 code was i guess some water got in the coil on the top, thats the rpm signal 2, the coil went bad so i replaced that fixed that code; then, the knock sensor was when i had reran the knock sensor i didn't hook it back under the coil which caused the serp belt to rub it and eventually cut the wire so i had to go to pick n pull and get a new after that the idle went back to normal on both cars and ran fine. So to recap check the MAF sensor, make sure the rotors on correct, check if knock sensor wire is cut and replace coil if needed