When I found mine it had 143,000 miles on it and idled funny. After a good tune up (plugs, wires, distributor cap and rotor, filters/fluids, etc) it was running great and hasn't gave me any real problems since (besides the radiator blowing last summer and the automatic going out last winter, but I guess thats to be expected after nearly 150k).
There is a good writeup at
http://www.z31.com about what to look for when buying a car. A lot there just talks about what to look for in a z31 specifically, but a good bit applies to all cars. Take a look at that, I think the link is on the home page, it says Buying a Z31 or something like that.
Carfax is a great idea too. About a year after buying mine I ran carfax and found out a lot that I wish I would have known. Mine was in three front end collisions in the late 90's, but I guess they did a good job fixing everything because the only problem up there is excessive negative camber on the passenger side that eats tread off my tires.