Its an INSTANCE variable, not a CLASS variable. Class variables have a completely different scope.
To make a variable callable via a script call or whatever, pick a class that is already globally defined, like Game_System, Game_Map, etc. and do something like this:
Actually that is all you really need, but it is important to remember that at this point it is not initialized and is nil, so add something like:
@my_variable = 3
to Game_Map's initialize method as well.
Now, to access and change it via a script call, you can do this:
$game_map.my_variable = 5
$game_variables = $game_map.my_variable