Rate of self-lynch offer:
Lynch (probability p):
m/(2+m+w): Lynch Mafia, Werewolf win
w/(2+m+w): Lynch Werewolf, Mafia win
2/(2+m+w): Lynch Town, 1:1:1 (EV 1/4)
Town EV 1/2(2+m+w); Mafia EV w/(2+m+w) + 3/4(2+m+w) = (3+4w)/4(2+m+w), counting the draw as 1/2; Werewolf EV (3+4m)/4(2+m+w)
Don't lynch offer (probability 1-p):
After the second lynch offer (which is carried out), the probabilities are:
m/(1+m+w): Mafia "confirmed"
w/(1+m+w): Werewolf "confirmed"
1/(1+m+w): Town "confirmed"
Going into night, consider the perspective of the Mafia player if not in the "confirmed" position (probability (1+w)/(1+m+w)). From this player's perspective, there is a 1/(1+w) chance the Werewolf is "not confirmed" and a w/(1+w) chance the Werewolf is "confirmed". It is at least as good for the Mafia to shoot the "not confirmed" player (it is the same if w=1).
The same goes for the Werewolf player in a "not confirmed" position.
If a scum player is in the "confirmed" position, the choice between the two "not confirmed" players is random. This our EVs are:
m/2(2+m+w): Mafia win (confirmed and shoots Werewolf)
m/2(2+m+w): Mafia/Werewolf draw (Mafia confirmed and shoots Town)
w/2(2+m+w): Werewolf win (confirmed and shoots Mafia)
w/2(2+m+w): Mafia/Werewolf draw (Werewolf confirmed and shoots Town)
2/(2+m+w): Town win
The Town's overall EV is: p/2(2+m+w) + 2(1-p)/(2+m+w).
Optimal p appears to be 2/3, with EV of 1/2 - there is actually a second "Prisoner's Dilemma" situation in terms of the m and w values. At 2/3, if w=0, EV for Mafia is 1/4 for any m. If m=w=1, EV for each is 5/12... but if w=1, Mafia does better with m=0 (17/36). For any w>0, Mafia EV is max at m=0, and vice versa, so both should pick 0.
(This isn't quite a proof that p=2/3 is optimal, but for p>=2/3, the above argument applies, and m=0 and w=0 are optimal for the scum factions; given the town EV is better when the self-lynch offer is declined, you want p to be as small as possible for fixed m and w.
For p<2/3, optimal m and w are greater than 0, and the resulting EV seems to always be worse for town. For example, at p=1/2, optimal m=w=3/4, and town EV is only 1/4 again.
For p between 6/13 and 2/3, optimal m=w is (6-9p)/4p, and resulting town EV is (4p-3p^2)/(6-5p) which is increasing over this interval. For p<6/13, m=w=1 and the argument for who they shoot at night breaks down; note that at p=0, m=w=1, town EV is again 1/2 in the above formula - more on this in next post. For p>2/3, EV is (4-3p)/4, so we want p to be small.)
Town also has the option of choosing between the first self-lynch offer and no lynch, and in fact I think this is exactly as good - the cases at night are:
Cross-kill (1/4) - Town win
Mafia kill Werewolf kill Townie - Mafia win
Werewolf kill Mafia kill Townie - Werewolf win
Both kill Townie - 1:1:1 with remaining townie confirmed, Prisoner's Dilemma Town win.
You could also try having two "simultaneous" self-lynch offers, and then randomly choose one to lynch and the other to consider confirmed. In this case (since p=1/2, in some sense), optimal m and w are greater than 0, but the change in strategy may counteract the loss of control.
Anyway, if the 1/2 EV result holds, this is in some sense the perfectly balanced setup. (In another sense, 1:1:3 is, as all factions have an EV of almost exactly 1/3.)