It depends on the size of each write. If you are writing small chunks, like 4 bytes, then you can easily make sure the start and end do not end up in different pages by dividing the start & end locations by 128 and see if they are the same. If you use integers, the remainders should truncate rather than round so you won't need to use mod. Then, if they do, to simplify it just write the whole thing one byte at a time, waiting for the write time between bytes.

read the d/s on polling for write completion. Usually a write is about 1/10 or less than the "worst case" time spec'd out.