The reason your code doesn't seem to work is because the program checks if the B button is being pressed directly from the program's start. If it's not being pressed it skips the WHILE loop, terminating the program. You can fix this by instead wrapping a simple conditional in another loop. It could look like this...
WHILE 1
IF BUTTON() AND #B THEN
PRINT "OK"
ENDIF
WAIT 1
CLS
WEND
1そうだね プレイ済み