This is the sort of thing I could do, technically, but the question is the specs. You nominate dwarfs to the Senate, the script keeps their relevant traits around, and that Senate takes certain pre-defined sorts of votes? We players see ourselves as the will of the Republic, and limit our actions somehow?
Yes, you're mostly right. I figured that dwarf culture was work-centric, meaning that their governments would be designed around guilds (I called them "associations" in the plans I wrote up). The associations would lobby and compromise for the professions they represented in the legislature, attempting to gain them greater influence in the fortress economy.
Perhaps there are a lot of metalsmiths in your fortress. They would have a proportional number of association representatives in the senate that you would appoint based on their skill level, in this example, to the "Forges" association. During a session, they would propose a vote (that the player makes up) to do something like "expand the production of metal" or "increase the size of the forge workshop room". The rest of the senate, comprised of all the various association representatives would then vote on the proposal, using traits like "empathy" and "cooperation" to decide how they'd vote. Other factors like the linguistic ability of the dwarves proposing the legislation would affect the reaction of the senate. Measures that passed would be implemented by the player.
This sort of system makes logical role-playing sense, because the "government" as it is abstracted now is centrally planned. The associations act as a way to pretend that the central planning has some sort of democratic process behind it.
Political ideology votes would be separate from association votes. different personality trait levels would add or subtract "ideology" points. For example, Dwarves that admire tradition would gain "Conservative" points depending on how powerful their admiration is, and un-trusting dwarves would gain "authoritarian" points. The use of a calculation program would just make it easier to find out what the political alignment of each senator was, and then role-play the fortress in the way your "citizens" would actually have done it if they had free will.
Summary:
1. nominate dwarves to senate.
2. put their traits in the program. The program would tell their political alignment and how persuasive they are (all the
senators' stats would be remembered and their names/data kept in a list that you could add or take away dwarves from)
3. when taking a vote, you input the ideology that is benefited by your made-up legislation, and who proposed it.
4. calculations are done to see how each representative votes, factoring in the persuasion of the proposing dwarf and
deciding whether it passes or not.
Sorry if I wasn't clear, I'm exhausted right now.