Yes there's always a risk. But you can always do a carfax report on it.
As long as there wasn't any frame or otherwise significant(flood, rollover) damage that warranted a salvage title and the repair shop did a good job on it, you should be fine.
A guy backed into mine a couple of years ago. He was backing out of a parking spot and didn't see me behind him. It didn't do that much damage, but it warranted the replacement of the front bumper and passenger side headlight casing. The body shop did an awesome job of repainting the front bumper and matching it up. I'm putting it up for sale soon (changed jobs and don't want to struggle with the payments) and I'm not even going to factor that into the asking price (as far as it being lower because of it). Why should I?
The dealer should have the most recent carfax report on that vehicle available for you. If they don't, ask. You'll be able to assess at least a little bit of risk by how they handle that. You can also have a 3rd part inspect the car where damage was fixed.
I was in the same situation. Bought mine used from a dealership. They were upfront with the carfax which noted a minor rear end collision so I had a body shop check it out before I bought it. You like to think the dealership is truthful, but they don't call them stealerships for nothin'.
It's hard to put into perspective without knowing the details. Example: a $2.500 accident can be completely meaningless and a non-issue, while a similar cost could also cover more worrisome damage and generate a car best avoided (two bumpers needing replacement and a respray is nothing to worry about, while other stuff needs more thought).
Incidentally, no Impreza in history has ever suffered any frame damage, guaranteed. Not a single car -- no Impreza has a frame.
See if you can find any more details, and see if there is a service history for the car. That year has been recalled for minor issues (very common), I believe; does the VIN come up on the dealer's computer indicating service? Was it in an area where people drive on salt, not tarmac -- rust on the undercarriage? Paint? It's been across country -- is the indicated mileage realistic?
Having a body man make $50 for an honest opinion might not be a bad use of money.