When a dwarf comes past an acquantance or a friend (within 5 squares), there should be a chance that a social event happens. The event happens if either both or just one of the dwarfs roll so it creates the social event.
The chance of an event happening should be set low - so that the fort does not get bogged down in chatter and nothing gets done, but also high enough so that it happens frequently. IDK maybe 5%.
The chance of the social event should depend on a) how long ago have the dwarves socialized, the chance increases the longer they haven't done it b) some jobs should have zero or no chance of socializing (for instance a doctor on the way to operate should have a very low chance of socializing on the way to get to the hospital, the events also don't happen in temples, barracks, libraries as it is improper there.).
Some jobs should have zero chance of it happening (soldiers with a station order, and active military in general) and ! jobs should also have zero chance of it. Under invasions the chance should also be set to zero. (And I am sure I forgot some things. The general idea is that they do it on the way to craft some stone goblets, and that the army doesn't pause to socialize while they're on their way to help some dwarves being slaughtered by a werebeast.)
Pherhaps it should be possible to create no-socialize zones. It depends how much the player is supposed to control it; personally I'd feel fine about accidents happening because the dwarves stood and chatted about the weather in a dangerous place. IDK what most player would like.
The social events are A) simply greet each other B) have a short chat for a minute C) pause whatever they are doing to have a conversation which takes a little while. The C could be taken from the list of events that happen in the tavern; honestly it would be fine if they sometimes sung a song together in the hallway.
The probabilities of which social event happens should depend on the dwarves relationship status.
For acquaintances say 90% for A, and 2.5% chance for B and C.
For friends, relatives, relationships 50% for A, 25% to each B and C.
For children the conversation is replaced by "play with."
Unacquianted dwarves/other people never even greet each other.
Perspectives: Undoubtedly this would affect the layout of the map, depending if the player wants hallway chatter or not. It would mean a design with a big central hallway/staircase would lead to a lot of banter, and then you could make seveal smaller staircases if you didn't like it or if it got too much.
It would make it more interesting to follow the dwarves social life, it would make it more realistic, and it would probably create some surprising places for a lot of socializing happened. It could lead to the player having to separate two armorers from working in the same room, in order to have them focus on their work.