Typed response, "backspace" and "space" only work once

You don’t need to code this yourself anymore. Delete your text stimulus and replace it with the new TextBox component- this can handle editable text for you, with no need for custom code.