I didn't read it, sorry. I can't tell what setLayoutDirty does exactly - I just know that all "Dirty" functions call external Gamebryo DLLs to update graphics. There's plenty of them, and they are needed when players are switched - for instance the name and leader update functions call dirty on the flag, names, icons, scoreboard etc. city->setLayoutDirty must have something to do with cities so I assumed that's it - there might be another one, but the Era function is called when player advances an era to update the graphics.
Anyway, player switching to respawned, modified civs caused city ruins in SoI as well, and now this problem is gone, as I just tested switching to both Cilicia and Sultanate of Delhi (which has new name, flag & civ type). Honestly, I don't know why, but my setflag and civ type functions have those extra dirty stuff I added while testing, compared to the original RFCM release - you can check in the sources. If that's not it, I don't know what it is, but it must be there
EDIT: One more thing, make sure you do the civ modification before the player switches civs. A lot of the stuff like units and presumably cities are not updated for the active player until the game is reloaded (or civ is switched).