If you have the time, pease open an issue on the repo to report bugs so I can fix them. I tested on the most recent version of Harlowe, which is 2.1.0, not 2.1.3 (which sounds like a Twine version, not a Harlowe version, btw), as listed in your tags. If you're using Harlowe 1.x that code may not work.
You can check the story format version from the change story format menu item in the up arrow menu on the bottom left of the screen, near your story's title.
There isn't much I can do about the code being long, it does a lot of things.