Not exactly a polyglot script, but a while back I had to work on a cluster whose job management system always ran everything as shell scripts. Or rather, it had to be run as a shell script in order to set the right cluster options. I wanted to submit an R script, so what did I do? I wrote a file that was both a bash script and an R script. When run as an R script, it does what I want it to do. When run as a bash script, it runs itself as an R script (after setting the cluster options). Problem "solved".
Here is is, if anyone's interested: https://gist.github.com/DarwinAwardWinner/2eb3705fb6ddab08ee...
And here's the Python version: https://gist.github.com/DarwinAwardWinner/8a631d897d45f00552...