Why the delay after analogue writing?
I don't think you have the right idea about multiplexing as far as the software is concerned. You need to activate each row in turn and while it is activated turn on the columns. Then turn the columns off before you turn on the next row. You can swap row and column in that above.
Look at how I have done it in:- Econo Monome