Well, if you insist on a more concrete solution...
I could see a fast-and-dirty check that takes place in realtime with any given excavation to check for serious problems, like completely cutting the last support out from under something, so that cave-ins that occur because you have supports holding up a wall that all collapse at once will cause that sort of intentional cave-in immediately when the game sees something like a wall just hovering in mid-air, and it would probably be best to have some checks for something like 10 straight tiles of overhang with no support to fall apart very quickly.
Beyond that, you could have a delayed every 500 or 1000 ticks check of all tiles that are potentially modified based upon drawing a cone upwards from the tiles you mined to schedule them all for having a support test.
I still say that shear forces on "overhangs" or "ceilings" are more important than compressive stresses (the kind of stress where you rest an entire mountain on one soap pillar).
I would think we could just start with whatever shear force will cause a generic stone ceiling under the strain of generic stone tiles to collapse, and then just extrapolate from there what all the other densities of stones/metals/woods/etc. and shear forces that will snap those same materials. This will, however, unfortunately mean that when we get real data for some of these things, stones like chalk and sandstone are probably going to snap like twigs. There may be nothing for it but to try to reinforce those walls with different materials.
In fact, I think it would be a better solution to have a "reinforce wall" type of construction, where you add supports into a wall tile. This could be used to put, for example, wooden beams in a dirt wall to keep it from collapsing, or putting steel crossbars to reinforce a chalk or rock salt wall and ceiling. Alternately, it could be done as a "replacement" wall, where you mine and replace what you mine with walls or supports at the same time.
We should aim for a generic ceiling to be able to handle 3 tiles of straight overhang at a time. That's enough for the 6x6 rooms. We can easily fit workshops in that, and we might be able to work stockpiles that have walls or supports every 5x5 tiles or 4x4 tiles.
OK, I'm not entirely sure my math will be correct on this, so someone feel free to correct me, here... The formula itself would be based upon leverage - the biggest strain will be on the tile that is attached to the wall, as I said before: (Side View):
#
####
#
#####
The underlined tile is under the most strain. It will snap when it hits its Shear Fracture value, which for generic stone is 15000. Therefore, I'm calibrating the formula here to make it so 4 tiles of overhang produces just over 15000 shear strain.
Now, not all these tiles are equal - the further they overhang, the more leverage they have in pulling down. To keep things simple, I'll assume that only half the first tile's weight applies to shear force, because we're averaging the distance away from the wall. The next tile's weight counts 1.5 times. The third, 2.5 times. The fourth, 3.5 times. Because, for this example, we are using an uniform material, we can just add these averages together for ease, and it adds up to 4.5 times the mass of a tile for a 3-tile overhang, and 8 tiles the mass of a tile for a 4-tile overhang. Since we're aiming for the difference to be between being under or shooting over 15000, having nearly double the leverage makes for a nice wide strike zone for our arbitrary formula.
The default density of stone from the template is 2670. Assuming some generic constant for the volume of a tile, we can multiply the default density by the leverage by the constant to find the total shear strain of this example, we could say, since the numbers add up nicely for this example, that the constant for volume is just 1.
For the 3-tile overhang, 4.5 * 1 * 2670 = 12015 < 15000, so the 3-tile overhang only exerts a shear force of 12,015 urists, and the wall can withstand 15,000 urists before failing, so the wall stays.
For the 4-tile overhang, 8 * 1 * 2670 = 21360 > 15000, so the 4-tile overhang exerts more than enough shear strain for the stone tile to fail, and a cave-in will occur.
I also want to point out, however, that we can have different thicknesses for all these materials. We have walls, which take an entire tile, we have floors, which take some arbitrarily small volume of a tile, and we could hypothetically have some sort of arch tile or truss support beams or something, as well. These could all have different masses, and have different thicknesses that are used when determining how much shear strain they will withstand.
You could, for example, make a room that occupies a 2 z-level tall area. Its sides on the second z-level are walls, but then it just becomes floors on the z-level above them every tile beyond that. This way, you could create a sort of "arch" in the ceiling, because floors and walls have different thicknesses.
_________
## ##
# #
#########
In this case, the leverage equation is different, because that wall tile is much thicker than the floor tile, so the floor tiles the wall tile supports put much less shear strain on the wall tile, relatively speaking. In fact, the first floor tile may be what snaps first.
If we had some sort of support that could be attached to walls to act as a truss that supports an overhanging ceiling or a bridge, this could become more smooth, and allow longer stretches, or allow players to make ceilings from less functional materials.
_____________
###/ \###
#/ \#
#############
Ultimately, however, I think that a more realistic cave-in system would cause players to either avoid materials like rock salt as a material to build their fortresses within in favor of materials more like granite, or else to replace all their walls or fortify them with wood or other materials that are lighter building material.