Firstly, thanks Allan.
A word of warning: 'enabled' must be a boolean, and adding it like above adds it as an integer, which will make TextMate throw an exception when executing shell commands (until the entry is removed).
I'm assuming that I can't use
defaults write com.macromates.textmate OakShellVariables \ -array-add '{enabled = true; value = "/Users/simon/classes"; variable = "CLASS_PATH"; }'
as it'll be interpreted as a string...
I'll make next build accept an integer as well.
I've written a clunky shell script that reads in the shell variables and then only adds them if they not already there, so I'll be looking forward to this.
Cheers, Simon