Do not go into standby when phone is plugged in
What version of Android are you running? In CyanogenMod and other versions look in SETTINGS > DEVELOPER OPTIONS > STAY AWAKE / KEEP SCREEN ON WHILE CHARGING

You might also want to take a look at this app, if the options aren't available to you.

Seems like this question has been answered earlier - How do I keep my Android 4.0.3 phone awake when USB connected?