Initial thought: It should be possible to set military squads to guard a dwarf as he performs his duties. For a miner, woodcutter, or fisherdwarf working in dangerous territory this would be a very useful function. I checked, and didn't see this anywhere, though I may not have used the correct search terms. But:
Subsequent thought: This is exactly the sort of thing nobles should demand every now and then.
Subsequent thought: Such a mechanic would open up the possibility of personality-based politics as a driver of late-game Fun in older fortresses, as nobles slowly develop retinues of loyal guards, and thus gain the means to resolve perceived slights with the blood of their enemies. For example, a current mayor or son of the duke who loses an election might flip out and use their personal retinue to dispose of the winner, or an influential captain of the guard who develops a grudge against the presiding noble might have him killed and take the throne for himself. And, as nobles demand bodyguards, other nobles gradually feel threatened and demand bodyguards as well, making it harder and harder to keep a regular army! Essentially the game would become, you have built your city, now try to keep it. And, in a game where 250 dwarves max are bouncing around, having late-game politics driven by personal conflicts and ambitions may be more thematic, and more appropriate to the scale of the game, than having the conflict drivers be more abstract forces like class warfare and economics.
Subsequent thought: If that's the case, it'd make sense & be thematic that dwarves keep track of favors that other dwarves have done for them, and problems that other dwarves have caused them, and form friendships and grudges on that basis rather than just talking to someone in the dining room. Probably your starting seven would all become friends anyway ("Urist made me a good bed to sleep in lately", "Unib made me a very good meal lately", "Sarvesh saved me from badgers lately") but as the fort grows you might get more complicated reactions ("Mayor Dakost had my husband imprisoned lately," "My son was killed under the command of militia captain Urist lately", and of course "My friend formed a grudge against Kadol lately, thus I like him less as well") and webs of allegiances could emerge and make for Fun and potential chaos in an otherwise established fort. This may be too hard to keep track of and work with processor-wise, however, and would be an entirely different interpersonal system in any case.
Anyway, I don't know how far this would need to go, but I think it's a different vision of the late game than much of what I've seen around here, and seems to point towards a nice arc of dwarven society degenerating as the dwarves get comfortable, something I've seen others express a wish for.