In order to have randomize() work as expected (and the Apple II random number generation in general) it is necessary to update the random counter during keypress wait just like the ROM function does.
jsr putchardirect ; Returns old character in X
; Wait for keyboard strobe.
jsr putchardirect ; Returns old character in X
; Wait for keyboard strobe.
+: inc RNDL ; Increment random counter low
+ bne :+
+ inc RNDH ; Increment random counter high
- bpl :- ; If < 128, no key pressed
+ bpl :-- ; If < 128, no key pressed