Please explain what you mean by different results.
Note: On Windows 7, this particular registry key is now the type REG_EXPAND_SZ. So you will need to call RegQueryExpSz instead of RegQueryValue.
Here are my results ( using a different environment variable ) on Windows 7 running as a 32-bit script:
REGROOT = @REGCURRENT
REGSUBKEY = "Environment[TMP]"
REGVALUEO = RegQueryExpSZ(REGROOT, REGSUBKEY) ; RESULT = %USERPROFILE%\AppData\Local\Temp
ENVIROMEO = Environment("TMP") ; RESULT = C:\Users\Username\AppData\Local\Temp
You see the registry key uses an embedded environment variable USERPROFILE, where as the Environment variable does not. This is expected on Windows 7.
I actually recommend using a single function call to ShortCutDir to get the Local AppData path then append the Temp directory name as follows:
TMP = ShortCutDir( 'Local AppData', 0 , @TRUE ) : 'Temp\'