I'm not sure why it would ever be necessary to add that code to the bottom of the page. That is why our extension doesn't add it.
To make it not case sensitive you can wrap both code sections with strtolower(). That would be added both to the compare value on the main page and the compare to field in the popup. If they are both converted to lower case before comparing it will make it effectively case insensitive.