But yes there is actually a lot of literature on this! The state between waking and sleeping is called hypnagogia and is documented to produce creativity!