This is a trivial plugin that launches EmulationStation by exec'ing it. I run Kodi as a systemd service so when EmulationStation exits, systemd starts up a new instance of Kodi.