Well, I got the same idea. My objective was to start a mame game (Star Wars) automatically.
After spending some time to set up this, I wanted to share the solution to complete the explanation available of the Retropie FAQ.
So here's the content of my autostart.sh file :
pi@nunopi:/opt/retropie/configs/all $ more autostart.sh /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ "mame-libretro" "/home/pi/RetroPie/roms/mame-libretro/starwars.zip"It works as expected! Quite easy with an example now :-)