I usually do just press Ctrl+r to search the command line history, enter "setup" to get the last setup command, and press Enter to run it. But mitu's solution is much more elegant (and persistent, depending on the maximum length of your command history). 👍
By the way, one thing that you might find useful is to start the setup inside a screen session, so you can logout while setup keeps doing things like updating or scraping:
screen -dmS setup sudo ~/RetroPie-Setup/retropie_setup.sh && screen -r setup
or with mitu's alias:
screen -dmS setup rpie && screen -r setup
The && screen -r setup at the end enters the screen session immediately after its successful launch. You'll notice no difference to running setup without screen, but you can detach from it without killing setup by pressing Ctrl+aand then d (for "detach") alone. You can reattach to a running screen session by entering screen -r in the command line, optionally followed by the name of the session (e.g. screen -r setup) in the case of multiple running screen sessions.
After detaching from screen, you'll be back in the command line and you can logout normally without killing any running detached screen session. Then, you could even relogin to RetroPie from another machine and reattach yourself to your screen session from there.
Sorry for the slightly off-topic lecture, your question triggered my "sharing is caring" mode. 😇