There is a little problem on your really helping code
if i place a value $FF (but i suspect <> $00) in $2A1 :
*= $02A1 byte $FF
your example freezes!
Interesting .. the C64 memory map I normally use says $02a1 just used for saving CIA2 interrupt control register during RS232 I/O.
Edit: I reproduced this issue too.