Code:
dim $var
$var="var"

? $var  ;outputs var
test()  ;outputs test
? $var  ;outputs var

function test()
  dim $var
  $var="test"
  ? $var
endfunction


My apologies if this is not necessary, but I thought I would take a step back and explain the localization of variables. If we are only talking about dimming and not global, when you dim a variable inside a function(or other stucture), that var is only used inside the function. As you can see from above, the same variable name can be used multiple times without it effecting each other. It's probably not good practice to reuse variable names, but if you use setoption("explict", "on") and properly dim all your variables, there should be no reason why you can't re-use var names. I have many UDFs that use $i and $j for counters, and some of those UDFs call each other. However, because each function has the vars locally dimmed, there is no issue.