Yes, that fix works, but doesn't accomplish what the original CAVERUN was trying to accomplish, which is to create an "infinite" cave by using SHIFT MATRIX UP as the player moved forward.
I had deleted some other code for this example, but the original code generated some more random cave floor on the back edge of the matrix just before it did the SHIFT MATRIX UP. I think this was the original author's reason for doing the
followed by the correction to POSITION MATRIX later on. Otherwise z# and the numbers used in POSITION MATRIX could potentially grow unbounded if that -200 correction weren't continually applied to z# (200 being the same size as the z-axis dimension of a single matrix tile).
What is weird is that the sample code works perfectly in DB Classic, and looks awful (both the lurching and the weird cave roof) in DBPro.
In DB Classic, one gets a nice roof and an infinite corridor of constantly changing cave when moving forward along the +Z axis. Yet it's only a handful of instructions that do *not* work at all right in DBPro. I'm a bit stumped!