Setting environment variable for sudo in Yosemite
Your first line of code is wrong. If you say sudo and with administrator privileges you are doing the same thing twice. If you use the terminal, as you can see, the following works:

$ sudo launchctl setenv TEST true
Password:&lt;you have to insert your password here&gt;
$ sudo launchctl getenv TEST
true


You could unset the variable with the command:

$ sudo launchctl unsetenv TEST


You don't need an applescript to do that.