The line
You need to copy the folder $BLOG_ROOT/plugins/mastodoncomments/files/assets to $BLOG_ROOT/files/assets
is followed by
cp -a plugins/mastodoncomments/files/assets files/
which looks correct, but gets confused if files/ doesn't exist yet (as in my case). In that case we need to create files/ first. Something like:
[ -d "files" ] || mkdir files
cp -a plugins/mastodoncomments/files/assets files/
should do it, or else text telling the user to make sure files/ exists.