The command dontshoot is used to disable attacking enemies. It does not work for scripted goals (mortar, grenade, airstrike).
You can modify line 72 in file goal_mobilemortar.gm:
if (!Map.DontShootMortar) {
this.Bot.FireWeapon();
}
Then set Map.DontShootMortar in planted/defused/destroyed triggers.