It is a risk, but if you buy from a reputed dealer, there should not be too much of a problem.
i personally have bought a guitar off musicians friend, and had no issues with it.i have also bought a guitar off e-bay, which even though, it was delivered in perfect condition, i don't recommend, as there is a higher risk.
The question is are you sure you want the specific make of guitar? If you are then I don't think you should have much of a problem, as the only real difference will be how well the guitar is set up.
It would be even better if your friend could go to the store and buy it for you, as he could inspect if there are any scratches, no broken parts, and maybe he can even ask the the salesman to play it for him, just to make sure it sounds okay.
Guitars: Fender CS Strat, MIM Telecaster Deluxe, Epi Hummingbird
Pedals:EHX-killswitch, BMP w/wicker,small stone,cathedral,nano q; Earthquaker- hoof,tone reaper,bit commander,organizer;Wrenn and Cuff BOW;Sunface; Musket; FuzzFactory;Boss SD1 (original,analogman,keeley),RV3,TR2,CS3, RC2, space station; EB VP jr;Behringer multifx,digitaldelay,gcb 95 wah