Unsure what you are saying, in that piece of code you declare %x as a local variable, you never unset it.
But /inc or /dec are unrelated to local/global variable state (although just like /set, they will create a global variable if the variable does not exist). You (in theory) can't have a local variable and a global variable at the same time, more importantly, if you thought /set was meant for global variable, well, that's wrong as well!
//var -s %a 1 | set -s %a 2 | echo -sg %a -- $var(%a,1).local | unset %a
* Set %a to 1
* Set %a to 2
2 -- $true
----
//set -s %a 1 | var -s %a 2 | echo -sg %a -- $var(%a,1).local | unset %a
* Set %a to 1
* Set %a to 2
2 -- $true
As you can see, /var defines a local variable, but after that, you can use /set to change the value of that local variable, /set really just set the variable, and only if the variable doesn't exist as a local variable, /set takes the liberty to create a global variable.
The syntax "%var = " is simple an equivalency of /set, this can be observed using the following:
Note that you have an undocumented -l switch for /set, which changes the state to a local variable (or just set a local variable if the variable doesn't exist, of course):
//set -s %a 1 | set -ls %a 2 | echo -sg %a -- $var(%a,1).local
* Set %a to 1
* Set %a to 2
2 -- $true