I assumed that calling lock/unlockscreenupdate would stop this from happening. Or have I misunderstood how the unit works?
Yes you misunderstood a little bit
What
video does is to provide
VideoBuf, a "buffer" where you write (by changing its elements) and move to screen with
UpdateScreen(). If you want to prohibit "writing" in the screen for performance reasons then you can use synched calls to
LockScreenUpdate and
UnlockUpdateScreen but all they do is to prevent
UpdateScreen() from doing anything.
Standard procedures like
Write() and
WriteLn() will still use their own method to access the screen, either through the handle, DMA, or whatever, depending mostly on whether you also use CRT, but unlike happens with this last, they won't be aware of the special methods in
video.
What the
video unit does is quite well explained in
the documentation. What it doesn't, though, is undocumented.