Ok, sorry, I misunderstood src/AIModule.cpp, around the condition "if (_save->getMissionType() != "STR_BASE_DEFENSE")". So in base defense missions the scout mode should always be enabled, not just forced on after turn 20.
But the real question then is what I wondered already: why are the aliens (in some base defense missions) just minimally moving back and forth where they are, compared to the open UFO recovery map and at least eventually coming at you? If it's supposed to work roughly the same way, is there a bug or what's explaining the difference?
"scout mode" and "cheat visibility" are two unrelated things
"scout mode" is always disabled for base defense (as you already found out)
"cheat visibility" is enabled and works the same way as for other missions
they're moving minimally, because of various reasons, there's no single reason... the parameters of the mission and the map just prefer ambush and combat over patrolling; the patrol nodes are not optimized for scouting, forced scouting (a.k.a. "scout mode") does not apply, player actions (or non-actions) result in similar alien reactions, and so on and so on...
AI "intelligence" in (open)xcom is an illusion, see below.
From this perspective, I kind of agree. I would just like to understand how this is supposed to work. If the base defenses are supposed to be alien "hide and seek" and "attack the aliens" missions, fine. The contrast is just very high, when most of the time the aliens appear come at you in a rampage instead. Well, I suppose one could argue that it's good that the player cannot anticipate in advance which behavior the aliens are going to adopt.
In the same vein, the current game is "broken" from player perspective by offering way too much cover in your craft in terror/UFO/base attack missions so that staying in the craft is often considered more or less cheesy. Obviously in some mods this may be mitigated slightly (e.g. crafts which only drop you off and don't offer cover), but this needs to be taken to account when balancing the game. In some missions the difficulty is scaled in such a manner that the missions are not really survivable if you immediately exit the craft full-out.
There is (intentionally) no rule or algorithm how it is supposed to work.
If you do some actions, it will turn into a "hide and seek"; if you do other actions it will turn into a "attack the aliens". If you do yet something else, it will turn into "something else".
Xcom AI is extremely stupid, you could even say there is no AI.
It's just a set of a few rules, what to roughly do in response to the general game state (game state being most heavily affected by player's actions) and the RNG.
It's almost purely reactive, the aliens DO NOT have a plan.
Practically everything we could call "intelligence" is a complete illusion in xcom... an "emergent behavior" if you wish.
It's not the aliens who invented let's say camping... it's the player who observed a certain response pattern based on a certain playstyle... and called it "alien camping".