There is (or was?) an option in developer settings to keep the screen on when docked. I no longer see that option on my phone, but I'm not docked, and maybe the option only appears when you're connected. Anyway, check for that option.
Otherwise, profile programs like Setting Profiles will do this. I haven't tried Llama, but it probably offers the capability, too.