This is not directly supported
SCION initializes SCXML code inside of a sandbox. In node.js it uses the vm module for this, and in the browser it executes the SCXML code inside of an iframe. Code executed inside of an iframe has a different global object than the global variables initialized on the page into which SCION is loaded.
For that reason, you need to expose global variables to the SCXML scripting context, and there are two ways to do this:
You could initialize an API object, and pass that into the state machine as an event, for example, outside of the state machine run:
//define your API, which references global variables
let api = {
setBlockStyle : function(){