Just an idea: neurotechnology (EEG) + computer + IV-based neurochemical moderator (drug) = 4 hour lucid dream (?)

I'll explain. When we awake from a lucid dream, it happens because the neurochemical balance necessary for REM is destablized by excitement. It's a conscoius "cause" with a subconsious "effect". What if a drug could be administered in this fleeting moment to stabilize the dreamers' neurochemical balance to maintain REM/lucidity before they wake up?

An EEG can detect REM or even lucidity in real-time, so this acts as a digital trigger for the computer to activate an IV pump to administer enough of the drug in that moment to keep the dreamer in REM for a very extended period of time.

I would make a pretty good mad scientist