the script found the state parameter at the bottom of the article, and was confused about what to do.  I added a couple more lines to the script, so it should work for this case now.  the fact that there can be multiple "| state =" on one page is tricky, and will always be a difficult problem to solve.  luckily it doesn't happen that often, and if the script doesn't do it properly, it's really a minor problem, since it just means that the state option is added somewhere where it does nothing (e.g., in the documentation).