Several people I follow in Twitter have pointed a quite useful looking tools called ShellCheck. It will scan shell script code for common problems that may lead to errors later, especially quoting.
However, the script is written in Haskell, which brings with it a rat’s tail of dependencies if you want to install it on your own Mac.
Since I did not want to bother with that I wrote a script that will grab the code from the frontmost BBEdit window and paste it into the webpage:
Drop this in your BBEdit Scripts folder and enjoy!