the hard part is expected behaviour
for example, let's take a simple open setup where the only power role is a vigilante - you can easily write a program that calculates the odds if, say, the vig shoots every night (maybe with an exception for it being odd numbers near lylo), and we can call this behaviour "expected behaviour" or "optimal behaviour" and
but let's also say that "expected/optimal behaviour" for scum is to kill the vig as soon as they know who it is (perhaps not the case in a different setup, but for the purposes of an open setup where the vig is confirmed to be town, this is optimal play). what if, for example, the vig is run up d1 and forced to claim? is it expected that a vig will always truthfully claim their role in a setup like that? how do we calculate the odds of the vig claiming by day X? i suppose you can write in something that says "expect A claims to happen per day (based on B players alive) and a mass claim to happen by day C (based on total amount of players D)" and, with the assumption a vig will always claim truthfully, factor that in to calculations, but the point here is that it's a little more complex
let's suppose a slightly more complex scenario. let's say we're playing a thirteen player game with a cop in it and let's say town mislynches d1 and that cop gets a guilty n1 - does he claim the next day? some might. others would try and push the guilty really hard and make it obvious they have one even if they don't explicitly claim it. and others might be a little more subtle about it and push it in a non-obvious way. others still might try to be "really subtle" and make it not-at-all obvious that they even have a guilty (i would say this is utterly stupid, but i've seen certain players do this before, as baffling as it is). we can make calculations based around optimal play and assume that scum cannot guess who the cop is based on their day play (giving the cop more opportunities to get results), but that won't necessarily reflect the odds of something happening in a real game (because optimal play is so very rare in mafia)
this gets more and more complex the more variables you add in and assumes you're not missing things (e.g. maybe optimal behaviour is something you're not even considering...)
and to top it all off, even if you somehow manage to calculate the odds based on a number of expected behaviours with definite numbers, none of that necessarily matters. for example, if your game has a single town power role in it (say, a cop) and that power role dies n1... you're now in a mountainous setup and, odds are, it just became heavily scum-sided. if that cop lives to, say, d3/d4, then perhaps it becomes extremely town-sided. while the game might be balanced if played 100,000,000 times, for a single instance of the setup (which is going to be the case for most setups), the swing factor is far more important than the overall balance (which is why a lot of mods try to split power among a lot of less powerful roles rather than a lot of power in just one or two roles, so that no single role dying/not dying will change the EV of a game in a really massive way)
was rambling a bit here (i don't have much work to do this morning, so *shrug*) but the tl;dr of this is that it's not easy to write a program that determines probabilities of non-mountainous setups
i actually wrote a program a while back to calculate mountainous odds and posted the output here, but i think i deleted the code shortly after i wrote it