I was seeing a similar issue with my setup and after enabling some script debugging I was seeing the following result from the dpkg-query command:
pi@retropie:~/RetroPie-Setup $ dpkg-query -W '--showformat=${Status} ${Version}' lsb-release
Segmentation fault
This lead me to some articles about refreshing this package so after running:
pi@retropie:~/RetroPie-Setup $ sudo apt-get --reinstall install dpkg
I was back to being able to successfully complete a run of the /home/pi/RetroPie-Setup/retropie_packages.sh command again.