There's a behaviour called MissionCombatantsLogic. This is the mission behaviour that sets up the teams and sets mission type to siege battle. Mission.IsSiegeBattle is set only after the execution of this code section. So if you haven't included this behaviour in your modded mission or if you haven't written your own, then IsSiegeBattle won't be set. For the campaign side, you can check MapEvent.IsSiegeAssault.