The Xbox One is capable of installing games when in sleep mode into its internal storage. However, is it able to do so with external ones as well? Do I have to keep the console on the whole time to install into an external hard disk?
Yes, your Xbox One can install both digital and physical copies of games while in Sleep mode. I have done this myself enough times to verify it, but here is an additional source.
Likewise, the console is able to install either to internal storage or external drives while in sleep mode. It will attempt the install to the drive with most free space.
It is possible to do it just make sure you have the right power option The power option is in System < Power and startup If you haven't do the startup Instant-on.. That's preferred for me and you will find while Xbox is off, Turn off storage, un-check it Now you can download while Xbox is on sleep..