If you can find a brand name(Trek, Cannondale, Giant, Fugi, Surley), used road bike that fits you, $400 should buy a good one. Remember, FIT is first.
After that, you'll be dealing with lot of components: wheels, gear, derailleurs, shifters, tires, seat, brakes, etc. Replacing these can add up quick.
For instance, the brake pads might be worn out or dry rotted, the rim side walls weakened by braking action, gear teeth worn out, cables worn out, bottom bracket and/or wheel bearings loose. Goes on and on.
Without in depth knowledge of all this stuff, your best bet is to take it to a local bike shop and have it checked out before buying.
OTOH, you might find a jewel out there in perfect condition. Never know 'til you look.
Good luck.