They shouldn't attack if they will hit more of their own than the player - have you seen this happening?
No. They seem to behave in [only activate if # of gangsters <= # of allies] manner or similar. Haven't deliberately tested though. For testing AI hanging tried some situations like 2 enemies and 1 ally.
My impressions are indeed very subjective, including about frequency. An example: Ray adjacent to a container similarly as in the picture above. Mafia guy starts his turn one tile away. He does one step, switches from hammer to HtH (which is neat as it saves ap), sets it off and... ends turn. I swear, wasn't distracting nor harming him in any way. The whole operation must cost 4AP. Maybe he gets something like 4AP per turn? Or from a statistical pov - concludes that shooting Ray has a too low CTH in comparison to sure blast damage? Dunno.
It can happen just haven't seen often. Recently have seen a church lady to set it off and run away from the aoe.
For the record, haven't looked at HP or other nuances. Why was thinking they do it to their detriment was mainly when one is sacrificing self or a comrade. It's a huge deal when a unit is rendered combat-incapable. They are initially more numerous, so looks worth for them to sacrifice when it can put down an ally too. However, if it happens just because an ally of full health was hugging a gas canister... Well, thanks it saves me AP, healing costs less than finishing an enemy, besides attacks can miss. Even when it deals more damage to more allies -> my guys are still in the battle while the enemy unit sure isn't. Depends on numbers and on queue, in some cases that ends worse for gangs too. I understand it's all highly situational and subjected to design and fun. Not at all trying to say how it should or shouldn't be. Only crudely evaluating. If you intended such identity for churchers, sounds pretty neat:) People are scared of those with low self-preservation... Their numbers may as well support this well.
Some example:
Healthy Sam and Emilia were harming Ivo. Raul decides to do something. Moves as highlighted on the left, sets off the container in HtH, then he moves to the tile at the corner (see on the right), then ends the turn. This one is interesting, not only he sacrifices Ivo but he also moves those two steps to stay withing the aoe.
If it's the last guy standing I guess it's debatable if it's going to be better to try and escape as they very likely have lower AP, and it usually only takes one bullet. Setting off the container is likely to cost the player an hour in healing. Will think about it though.
You're a spot on with that. I only did comparison like 0% vs. ~1% chance to survive. When the battle is pretty much lost (such as was also the circumstance of Raul and Ivo), harming us strategically makes a good sense.