Hmm I've never heard of tries before but that looks pretty close to what I'm looking for.
As for the size aspect, it might not make much of a difference in the gzipped filesize but there are other benefits to smaller raw source as well (but honestly I don't have any idea if it would be at all worth anything, I'm assuming no).
https://en.wikipedia.org/wiki/Trie#Algorithms
I'm not so sure it would take up much less space though, if you take gzip compression into account. See for example here:
https://github.com/google/closure-compiler/wiki/FAQ#closure-...