@B1bliomania: Well, the user running the script obviously has to be allowed to write to the mounted device's filesystem

.
Ideally, that should be done by your current user in both cases.
Unzip falling on its ass because of that (or any other thing) *should* have been caught by the script, though

.
(As in, with a printed warning and a non-zero return code).
FWIW, I've finished testing an updated script with a few extra sanity-checks, the packages have been updated

.