1) Open your script editor using Alt+R
2) Ensure the Remote tab is highlighted. If not, click on it.
3) If the page that shows is not blank, click File - New
4) Copy & paste the code (it's only the 3 lines that I posted in the Code tags) into the blank page.
5) Click OK to close the Script Editor.

This script will then be seen by any and all invite only channels that you try to join.