Shared variables are similar to C++ static variables.They are initalized only once - when the instruction pointer reaches the definition code, and they aren't destroyed untill the script is destroyed (when Execute called again it does not reset the variable). But they are not declared in the main block of the scipt, but in the parent namespace of the script (passed while creation or global). You have access to to such variables in all the scripts placed in the parent namespace of the script that defines it. You must load other scripts that uses the shared variable later, or define it in them - it is the recomended way.
Beware:
Shared variables may be declared many times in different scripts, but they are initialized only when the first definition is reached. So initialization code should be the same. In other case the results may be undefined.
Example:
shared Vec2f v(10, 10); //parametrized constructor initializad once