So, I traded my Civic for this 04 WRX with a 2.5L turbo in it. Runs and drives okay, but it has some issues. The body is fairly clean and it is fun to drive, but I think they may have cut corners when doing the swap. It smells funny, like if it were running rich, and I need to pass emissions to transfer ownership. It has a CEL that I need to clear in order to do this. I've checked the codes with an obd2 scanner and got 3: two are 02 sensors (bank1 and bank2). I can replace those pretty easily, but the main issue is a P1491. I guess the guy who swapped engines only swapped the engine and ecm, and left the wiring harness alone. While it still runs and all, there are a few plugs that just hang out and don't have connections to anything because (I'm assuming) the old motor did not have those sensors. The PCV valve is one of these empty connections.

The PCV valve is present on the engine, and the ECU is not detecting it because there is no plug for it anywhere on the wiring harness. I've opened up the wiring harness and followed it back almost completely to the dash and wasn't able to find that plug for the PCV valve anywhere. If my thinking is correct, the simplest way to fix would be if I can just jump some cables from the corresponding pins in the ECU to the sensor itself, and clear the code that way. Then, after I change the 02 sensors I'll be all set to pass emissions. Or so I hope.

Is that the best way to solve that problem? Anyone have a better solution or opinion?

I'm not sure what exact engine is in now, other than that it is a 2.5L turbo with DOHC. Here's a pic if it helps: