For many other reasons, my languages of choice are mostly PHP, Perl, and JavaScript. And I have experienced the types of bugs that static typing (and also immutability) can help with.
What I have found extremely helpful is to write as if variables are immutable, not allowing myself to change them. And to do sanity checks in the beginning of every function which expects a certain type of value.
Perl's taint and strict are of great help, but I haven't thought of an easy way to port them to JS and PHP. So whenever I can, I do the heavy lifting in Perl, and then use PHP and JS as glue.
The main reasons I have chosen these three languages is their ubiquity and their committment to backwards compatibility. With all three, I can carefully write something reasonable 20 years ago and have it still run today. Sadly, I recently came across a GNU/Linux distribution without Perl, but it is rare. PHP is widely available anywhere with a web server, Perl is ubiquitous in modern (post-2000) *nix, and JavaScript can still be written in ways which work in Netscape 3.x and up.
I think if you want to write software which continues working without too much fuss, it's helpful to exploit the Lindy Effect to your advantage.