Funny, I've been doing something similar some years ago. Also in Ruby and also using CSV's. "Resurrected" the project when we made the new Auto Correct groups for TextExpander 4. https://github.com/Zettt/ab...
Yours is much better written though. I don't want to look at my script anymore.
The script isn't escaping the contents or abbreviations of snippets. If some snippet contains < or >, TextExpander refuses to import the output file.
In case someone has missed it, TextExpander can also import CSV and TSV files directly. Save a file like this with a txt or csv (or tsv) extension and select it from File > Add Group From File.
ctrl,⌃
opt,⌥
shift,⇧
cmd,⌘