Another issue I just thought of.. If you do have that cluster of units, which is going to happen not just in sieges but in all your meeting halls, dining areas, dormitories, inns, temples, etc..
Each dwarf is going to do a detailed LoS check for every other unit in its vicinity, checking the tiles around it repeatedly, which sounds like the more-expensive part of the calculation than checking if their distance is <27
If you have to do a scan of the tiles around the dwarf for LoS to 20 units you're potentially scanning the same tiles 20 times , although that would be the worst case where they are all standing in roughly the same direction from you (edit: actually, isn't the worst case that you don't have real LoS to them, so you exhaustively check every tile you do have LoS to? not really sure how that works); might be quicker to exhaustively check all the tiles around the dwarf once if he's in a densely populated area, and this would at least scale only linearly with number of dwarves.
Edit: Possibly in the current way you could reduce some of the work by saying if dwarf A has line of sight to B on this tick, assume B has line of sight to A unless he has different sight distance. Yay still waking up. I think this would reduce the number of checks you have to do by about half, assuming most units have the same sight distance.
Also, maybe you could defer LoS checks for pairs of nearby creatures that you just checked - If I had LoS to you last tick, and we're still more or less in the same room, don't check LoS again.