Disable Android Device Sleep Mode when connected with Power supply
You can change the setting in Java with a couple permissions: StackOverflow question

Should be a breeze if you're customizing kernels. I already checked for a build.prop edit but seems that it isn't possible that way

Hope this helps,