What caused the error was not generated with your script.
It was working fine, but then I added some code manually and that was the problem. In the code I added manually I typed quotation marks instead of apostrophes.
@vitoriaseven: Which version of the app are you running? Look in Glyphs > About Glyphs. The number between brackets is the build number, is it approximately 900 or approximately 1000?
' should not be converted to ’ in the first place, this was fixed some time ago. Perhaps try updating to the latest cutting edge version in Glyphs > Preferences > Updates. Alternatively, right click in the text editing field and disable Substitutions > Smart Quotes: