Get on and ride..
...is the answer. If you're buying used stuff, you gotta ride on it. Ask questions about servicing and maintenance and you'll get a good idea of how much TLC a bike has had. If somebody is vague and trys to avoid giving solid answers you have to wonder...why? Think first about components that have a knock-on effect if they don't work, hubs being the main concern here. Even XT hubs will break down if they're not looked after and, even if the rim is OK, you're looking at many extra pennies to fit a new hub into a wheel. It may work out cheaper to replace the whole wheel.
Look very, very closely at all the components for signs of wear and tear, scratches and scrapes, and get a hold of stuff. Start of gently trying to move things in directions contrary to which they'd move in operation; wobble the rear mech in and out from the rear wheel. How much play do the pivots have? An XTR mech, for example, should have zero play. Get some weight behind the cranks to feel for play in the bottom bracket. With the bike on the floor, apply each brake by itself and wobble the bike, first forward and backwards and then grab the braked wheel at top centre and gently rock along the direction of the axle. This will check for play in the hub bearings.
Once you've gotten a feel for the bike when it's standing, give it a ride. And not just once around the guys drive. Give them some kind of deposit, or leave your friend/wife/dog with them, check the brakes work OK and take it down the street, treat it rough and listen for creaks and groans. Try pedalling hard from standing in top gear to check for chain-slip. How does it shift? Do the brakes do what they should do? Poor brakes are an excellent sign that a bike hasn't been looked after. If somebody doesn't adjust something they use on every ride, what are the chances they've had their hubs serviced? Check rims for signs of wear from maladjusted and grit-filled pads.
If you can get the bike checked over by an independent store they might tell you that the poor shifting can be fixed with new cables, or that it needs a new chain and cassette. You can then figure on walking away or knocking the price down.
It's real easy to get inadvertantly ripped off buying used stuff, as much through the sellers ignorance as your own.
If you find a bike that you like there's one final thing that often gets overlooked. Check the serial number, It'll usually be stamped under the bottom bracket shell. If there is any sign that the number has been deliberately obscured then you have to walk away, no matter how good the bike/price. You can even check with the police to see if a serial number has been registered as stolen, and Specialized have their own registration system. If an insurance company has paid out on a stolen bike then it belongs to them. If you're caught riding it, even if you can prove you didn't steal it, it will be taken off you without compensation.
Take your time, pay attention to the seller (but don't be afraid to tell them to butt out while you check the bike over), scrutinize every part of the bike yourself. If in doubt, get somebody else to check it out.
Hope that all helps,