looks like a decent grab for 500 bucks!
as for it running rough, do a little searching, you can pretty much bet on the problem (or at least part of it) needing a new full set of coils and spark plugs (the originals are highly prone to failure) (and oddly enough, they tend to fail in a way that won't set off engine lights and the car can still run)
depending on how long it was driven running rough, it may also need new catalytic converters or a PCM...