Thomas, I'm a total novice on adobe script. So this is going to show my dumb..ness. I have created a font with 8 glyph alternatives. I've created a .jsx script with the code you provided. When I run the script, it gives me errors of various kinds. Am I even doing this correctly, or am I missing a really obvious step? I've created glyph sets in indesign and made sure they match what the script refers to. I don't know. Would you mind telling me if I'm missing some steps?
The code is OpenType feature code in the AFDKO format, which goes in a font. Many font editors including our own FontLab Studio 5 or FontLab VI use AFDKO code as source, and can compile it into a font. (So do Glyphs, RoboFont and FontForge.)
So, you need a font editor, and you can consult its documentation on how to set up OpenType features.
Especially (but not only) if you come from a programming background, one good intro to OpenType feature code can be found here: The OpenType Cookbook - Introduction