Well, as I wrote...
Playtesting (once?) after adding two of the same tile isn't thorough enough to run into the bug.
Here is an example of replicable steps to mess up level 1:
1. In the starting room, change the 4th tile (upper row) to 06.
2. Save
3. Playtest (you can immediately close the emulator)
4. Change the same tile to 26.
5. Save
6. Playtest
The in-game level is now messed up.
After restarting the editor, so is the in-editor level.
I think maybe the problem is with ModifyForPlaytest()...
[Edit 1: No, it's not. If I comment it (and 'modify back') out, the problem's still there.]
[Edit 2: Also not fixed when I end ModifyForPlaytest() with "close (iFdA);" and start ModifyBack() with "iFdA = open (DISKA, O_RDWR|O_BINARY);".]
[Edit 3: Neither commenting out 0x11/0x21 or 0x91 compression, nor commenting out both, fixes it. I will try commenting out everything else one by one, and will report back later. Edit: It's not the compression, it looks like.]