My personal recommendation is to use this version of the script, to use the reset button to reset game/exit emulator/restart emulation station.
https://github.com/crcerror/retroflag-picase
Quick Press on Game, will reset the game only
Long Press on Game, will quit the emulator
""
Multi Switch Shutdown
with advanced shutdown features for more natural behaviour:
If you press restart if emulator is currently running, then you will be kicked back to ES main menu
If you press restart in ES main screen, ES will be restartet (no reboot!), good for quick saving metadata or internal saves.
If you press power-off then Raspberry will shutdown
All metadata is always saved
""