Can you do this with autostart.sh?
As a quick test I added an "echo" command so the file now reads:emulationstation #auto echo Are you there?
Then I pressed ctrl-D to start EmulationStation and quit with F4. The terminal asked "Are you there?" before displaying the retropie_welcome message and command prompt.
Note: this worked when using any of ctrl-D, exit, or logout to end the current bash login and call the autostart script. It did not work when just running the emulationstation command by itself.
So I think if, instead of an "echo" command, you used the startx (start the desktop) command, it might do what you want? Boots to EmulationStation on login and then, when ES quits, go to the desktop.
/opt/retropie/configs/all/autostart.sh:emulationstation #auto startx