You didn’t hear it from me, but this is how you’d set a mktoVariable from a script running in the Preview pane

Not that you’d ever want to do anything like that.

let mktoVariableName = "Submit Button Text",
    mktoVariableNewValue = "Go for it!";

const editorDocument = window.parent.document;

const variableLabel = Array.from(editorDocument.querySelectorAll("label"))
  .find( label => label.textContent == mktoVariableName );

const variableInput = editorDocument.querySelector("#" + variableLabel.htmlFor);

variableInput.value = mktoVariableNewValue;
variableInput.dispatchEvent(new Event("change"));