We'll need more information or testing on your part to see what is happening.
I just ran a VBScript with the following:
msgbox "%AGENTIPADDR%'
and it worked fine. So I ran a command script with the following:
REM %AGENTIPADDR%
Pause
And it worked fine as well. So I tried your Hello version, and it worked.
I have an ITMS install of SP2 fresh, NOT upgraded.
Help us out a bit more on this. Thanks!