I find the axis preview does not read variables from memory unless specifically initialized in the same gcode file. One workaround is to include the desired variables in Interp::_required_parameters. It seems this could be allowed some other configurable way.
Something down the line of "var #4000 = persistent" in one of the configuration files could work. This example would add parameter #4000 to the persistent variables.