I can see no problem there, it pretty much follows the JTAG.cmm script.
The only discrepancy I can see is right at the beginning:
WBRRLOW = ADDR ( from 0x40000000 - 0x40200000)
There's 256KB RAM, so it should be 0x40000000 - 0x4003FFFF.
But you should get error bit set if you write somewhere behind the RAM.
It's probably not the root cause but could you check it? I can see nothing else.
Regards,
Lukas