Very good question about scope. For those that don't know, scope is the context a variable can be used.
// myValue is a local variable and is not related to messageCache values.
// these are two separate variables and values.
var myValue = 'blue';
QIE System Variables are accessed with qie.setVariable() and qie.getVariable(). Although System Variables cannot have duplicate names, you may name any local variable or cache name the same. QIE System Variables can be in a specific zone or be in the global zone, but they will have the same behavior.
// No variable conflict
var myValue = 'Some value';
var otherValue = qie.getVariable('myValue');