I suspect your aftermarket downpipe and lack of engine management is your problem. If you were driving in a spirited manner when the CEL came on, it's possible you momentarily overboosted. The cheapest fix for you since you're trying to get rid of the car would be to unplug your battery long enough for your ECU to reset and try not to drive it hard until it sells. Most "Stage 2" maps are designed to regulate everything properly once you upgrade to a higher flowing exhaust and they either block or prevent such CELs from occurring. It probably wouldn't be a bad idea to get rid of the K&N intake and put the stock one back on if you can as that could also be contributing to your issue.
07 WRX (Albins 5MT + Blouch 20G)
Jorge Carrillo Tuned (365 whp/340 wtq)