The '04/'05 STI are often times considered the best ones to to own...
You want a car that has maintenance records (I haven't been the best at keeping mine). If you can't prove that a maintenance was done, I would focus on doing that pronto after purchase. Possibly use this as a way to lower purchase price.
You want a compression/leakdown test done before purchasing. Make sure to bring the car to a 3rd party for a PPI; depending on your location, bringing it to a performance shop that deals with these cars would be a good idea.
The other obvious things to look for like low miles, few owners, accident history (although, not all accidents may show on something like Carfax), and few/no modifications (be aware that it's common practice to part out a car of all aftermarket components before selling it, so be sure to check for this).