fix(engine): script variable persistence

related to #CAM-1876