I think you are just misunderstanding the intent of the command. It is not to avoid having variable values in strings, it is to avoid having variables in strings when what you want is the value.
Code:
; BAD! Variables in strings:
$USERPROFILE = EXPANDENVIRONMENTVARS(READVALUE("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\@SID","ProfileImagePath"))
; GOOD! Variables not in strings:
$USERPROFILE = EXPANDENVIRONMENTVARS(READVALUE("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\"+@SID,"ProfileImagePath"))
There are a lot of good reasons why you should avoid variables in strings, but this simple example should do:
Code:
"Value of variable $$FOO is '$FOO'" ?
"Value of variable $$BAR is '"+$BAR+"'" ?
If you run this example you will see immediately why variables in strings can cause problems.