Armies wouldn't do this for just anybody. I'm thinking, maybe you could create a very-hard-to-get trait that would have this effect. This way, the army would only go really crazy for good kings or exceptionnal generals. I don't know if it's possible to mod, but maybe create a trait that gives 50% chance of the army going berserk on the general's death.