What are some things you should check for on a new guitar before leaving the store with it? How would you go about checking the neck for warping and imperfections? I'm asking because I had to order from a local guitar store and I want to make sure I don't get a lemon because of poor quality control.

Physical marks/flaws, fretboard wear/damage, rust/excessive scratches or fading on hardware.
Check for imperfections in the finish, hardwear, frets, make sure the neck is straight, check for fret buzz, intonation, etc.

To check the neck, just look down the neck from the headstock.
Visually inspect for dents/scratches/blemishes/loose parts
Check action, neck relief, intonation
Check if the nut is not cut too low for each string (there's a quick trick to this, search google)
Check for fret wear and buzz
Turn the knobs and listen if sound cuts out or pops/scratches through the amp