Nah, I screwed up the script. <shame> I posted without actually trying it </shame>
This works though:
# By default this script does nothing.
sudo cp $(shuf -n 1 -e /home/pi/RetroPie/splashscreens/*.png) /opt/retropie/supplementary/splashscreen/00_random_splash/splashscreen.png
As you can see, it uses shuf, which is available by default, and copies the output to a new dir I made for this purpose (00_random_splash).
I must admit it is somewhat more cryptic than the while-loop approach, but this one fits on a single line! 😉