Seems like you understand it quite well. I'll test it over the next few days to see if it holds up. Looks like it will.
One small thing... Ideally, the text that is grabbed and placed via the script should end up being selected so that it can easily be over-ridden. Is there an easy fix for the script that will do that?
Set the output to "Insert as snippet" and wrap it in ${0:...}? you'll need to escape the ... bit of course.