the script does it as far as I know, in the standard IRC way.
JOIN #channelName password
according to spec 2812
, you can use:
JOIN &channelName password
so maybe change the # to a & on line 675?
Let me know if that doesn't work.
If your IRC server requires something else, I can help you if you tell me what the syntax is to apply the password.