ChatGPT can generate scripts that freeze all inputs

ChatGPT can generate scripts that, when run, will freeze the user’s input and will not let them unfreeze it because their inputs are frozen. I encountered this issue with an autohotkey script it generated while I was trying to get one to hold down the J key in a program:

; Hold down the J key indefinitely
m::
    BlockInput, MouseMove ; Prevent interference with input during the hold
    SendInput, {Blind}{J Down} ; Force J to stay pressed
return

; Release the J key
n::
    SendInput, {Blind}{J Up} ; Release J
    BlockInput, Off ; Re-enable normal input
return

It should not be able to do this as the only way I could escape was repositioning my cursor with the Ctrl+Alt+Del screen until I could use tab to restart my computer.

This could also be used for locking the victim’s computer in tech support scams, which is bad since most providers of remote connection programs are trying to stop people from freezing potential scam victims’ inputs.