It doesn't yet check to see if your moves are valid. It should always give valid moves in response. Also hold space to move a piece without it moving in response, and press "s" to cause it to move without you moving. It doesn't yet understand en-passant or castling. The code is messy and unoptimized, but it doesn't run too slowly. In fact I added an artificial wait time so as to make it feel more natural. The program makes many missed wins and blunders; However, it can beat Martin on chess.com.
I got the chess sprite costumes from https://scratch.mit.edu/projects/808439977/ by argentum47.