Just paste the code (just the code) into a blank notepad document. Then save it as web.config when you save it make sure you set the save as type to "all files" or it will actually save as web.config.txt which will not function...
Once that works then it will tell you where the error is when you run the script.
Good luck.