This will not set the contents of VarName to 1 or 0 because it Is literally setting the actual text contents of VarName to the text "local_A1", "local_A2" etc all the way up to "local_A100". You can see this by the fact that the last value shown for VarName is "local_A100"
You are trying to make a dynamic Variable - which is not that simple to do in Keyboard Maestro. When I looked into this a while ago I ended up using a Keyboard Maestro Dictionary instead.