I've highlighted a portion of text in that image; the value 650. I'd like to subtitute that value with a KM variable that one can set beforehand, but can't see a way to do this given that the text script editing field is one of the few types of input fields in KM that doesn't process text tokens.
You need to get a reference to "frm", perhaps using document.querySelector()
But it is hard to say without knowing more details, including the HTML of the target web page.
This is plain text in the variable, so you will need to run the command - I don't know how to do that I'm afraid. eval maybe? Alternatively, you could do something like: