I tinkered around a bit more and got rid of the extra script by moving the commands completly in the es_systems file. Here is the full entry, if anybody wants to add it themself. Just don't forget to create the docs directory in the roms folder. Also remember, that this is probably not well supported by themes.
<system> <name>docs</name> <fullname>Documents</fullname> <path>/home/pi/RetroPie/roms/docs</path> <extension>.txt .TXT</extension> <command>/opt/retropie/admin/joy2key/joy2key start; whiptail --clear --scrolltext --msgbox "$(cat "%ROM%")" $(stty size); /opt/retropie/admin/joy2key/joy2key stop</command> <theme>docs</theme> </system>