The fact that you repeatedly need to use such long comment strings in the middle of the code seems a fairly notable marker that this example still fits more naturally as a notebook. These can then be used to split the code up and tell the story you're ending up with here.