What i would prefer to see is maybe not everything the player can do, but at the very least snipers and mortars and other artillery like weapons should at the very least attempt to reach high ground. Not dither around indoors, in alleyways or under trees(just arcing weapons). Having a handful of powerful units just pass/fail to impact a map on nothing more then spawn RNG feels pretty bad.
I was designing (in concept) an xcom clone for years and I looked into alot of situations like this for how a programmer might address the AI. There were a couple things that I saw in terms of strategy that I ought to chime in about. This would require building an internal database of layout information for the map ingame similar to RMPs for the AI to access.
Superior positions are good but how do you define/label a superior position? In terms of height you want to check from the top of the map down where the tallest map blocks are - not the vertical height of one but the highest vertical dimension that has a Floor tile (not sure if trees have floor tiles or just object/wall tiles). You can get more detailed than this if you want but it would involve weighting the map block's vertical accessibility by doing additional vertical checks at intermediate locations inbetween the center tile to the edge (3x3 grid, etc) that way if its got a tall smokestack in the middle of it that wont define its accessibility as much.
(edit - in the game concept I was designing the map would have various waypoints and handles in it similar to the RMP system but also for predefining where these types of locations were so that it wouldnt have to be handled algorithmically... it also would have had waypoints that had an Inverse Linkage to them so that the AI could use them with tactical movement rules and would know which nearby waypoints that a given one Cannot Be Reached from. I dont think this is an option for openxcom though because it would dictate needing to define additional data for map blocks)(It was also going to handle "Object Binding" by connecting multi-leveled objects together via grouping, and establishing structural integrity so that you could have building and object collapses similar to XcomApocalypse, and there would have been weight tolerances so that it discouraged bringing Power Armor and Vehicles into and across certain structures because they could collapse - and you would take falling damage from it. And algorithmically it would also measure floor tiles connecting to each other with a strength based on its toughness, so if you blow a big enough hole in a floor and it doesnt have much support below it, it might collapse most of the floor but it wouldnt collapse the floor tiles that were adjacent to the wall)Now you want to check among those which ones are 1 map block adjacent to the given unit (increase by 1 radius if they have more than 100 TUs). And pick the one which is closest to them. They will look for stairs or elevators tiles to ascend upwards and take the closest path to them until they reach them. If the unit has reached a Roof then they will also need to move to within 2 tiles of the Edge of its floor tiles in order to get a line of fire at anyone on lower floors (make it 3 tiles if they are only on a 1 story building).
Its also important to program in variance like priority to go to the Roof, verses looking for Windows to fire out of. Big buildings like the ones in the EuroSyndicate missions will have AI going crazy trying to get up on the roof when they will likely only find themselves moving up to the Top Floor and not being able to get to an exposed roof.
(to address this bug you can weight that the 2nd or 3rd story is fine enough to gain an advantage)
(Edit - its also worth mentioning that some kinds of weapons are NOT good for shooting from an advantage point, either because of Accuracy or Effective Range, and it would be easy enough to set default standards for this so that the AI doesnt move units with Sawed Off shotguns and Holdout Pistols to the 3rd story balcony. Whether you could say they were more advantageous because of the vertical distance or not is questionable, but going to a higher elevation has a greater marked effect for what we'd consider sniping - or especially explosive weapons - and particularly grenades)Weapon Selection is also important for arcing weapons and explosives. Shooting out of a window is bad news if you have a rocket launcher, even though in real life a user of such a weapon would have no problems firing out of a window without hitting it. So someone using a blast weapon should only fire out of areas that have a Gap in wall tiles rather than a Window.
For the same reason someone with an arcing weapon (like a tftd deep one) should only look for Gaps in walls to shoot from because their projectile needs a more stringent line of fire to it - sure they can shoot out of a window but that wouldnt be the priority for movement. These units would set a higher weight to moving onto the roof.
(lets consider the Snakewoman mutant civvie, she has an arcing projectile spit attack, this would affect those units and they would try to move to higher elevations to lob spit as if it were mortars - in a way this would be beneficial since it also makes them harder to get into Melee with)
Another major AI advantage is taking cover intelligently. Hazard Assessment zones is one way to handle this. Measured in 5x5 blocks with the center of that block being the anchor for it. Starting for every 10x10 map block check from the top down to the first floor tile it reaches in the center, if that has an open center to it (there is a line of fire directly to at least 3 cardinal directions) then a Hazard anchor is dropped there - this is a vulnerable spot to be. The Hazard Anchor extends vertically from the top of the map to 1 floor below the location where the assessment was made.
(in Space most blocks would receive this, and it would be warranted because it is a very open place, even on the space station locations the first floor inside would be considered a dangerous place. However since it only targets 5x5 squares it means the AI will sorta move in a jigsaw fashion through space since its trying to avoid the center of each map block - but since you'd likely introduce variance by doing a Bravery check that may not matter)
But in gameplay the trick is detecting what is actually hazardous and which types of weapons are more hazardous. So while gameplay is going on any time an enemy makes a shot at the AI that unit will check the line of fire compared to its visibility (in an rpg type game a spot check would be made)... okay I know where the bearer of that weapon is now. Since that unit is now in danger drop a temporary Hazard anchor there... but then also calculate the field of view for the shooter from where they fired, in a swath (to avoid intense calculation maybe, step it by 2 degrees each time) and drop Hazard Anchors positioned in a grid for each ray traced on that which hits a ground tile.
What kind of weapon was used? Damage caused is one factor (Damage divided by the armor effectiveness multiplier actually) but Blast damage is alot more dangerous because even close counts with that.Effective blast radius * 10 is added to the Damage for this assessment.
(so a rocket launcher doing 120 damage is going to have double the hazard rating of a heavy plasma doing 115 damage, but a panzerfaust doing 120 damage with a 0.65 armor effectiveness and an effective blast radius of 3 is only going to be treated as doing around 215)(effective blast radius being calculated first by checking the actual blast radius, and if Power / Radius Reduction is lower then that value is used instead... common sense size here)
Maybe measure these hazard ranks for every 45 points total. Maybe add one rank to this if the weapon has at least 6 burst shots so that minigun style weapons are given some credit for that. Maybe take accuracy into consideration, add 1 rank if that weapon has more than 120% aimed accuracy (this would put shotguns in that category). Number of pellets from a buckshot blast should also be factored in but id say a multiplier to damage would be much lower, such as 1.0 + (Pellets-1)*0.1 so a boom gun would be treated as 95 damage for this purpose (+2 ranks)
This is for determining the level of danger that each Hazard Anchor has associated with it. The degree of danger for each one decreases one step for every turn that goes by... which the one who provoked that danger has not been spotted there (at the lowest rank it takes 2 turns for it to be cancelled). If that particular shooter is observed firing again redo that assessment and reduce the prior Hazard Anchors to the lowest rank. These assessments should only be done Once per turn.
If the AI observes a shot Impacting an area but does not observe the shooter who did it, it will drop a low rank Hazard anchor within the 5x5 grid that the shot impact was located. Maybe also use the trajectory from the shot to drop another anchor in the next 5x5 grid. This should only be assessed 1 time per weapon even if its got buckshot or fires multiple shots (the first one that hits is the only one that matters)
If a unit happens to be inside a hazard zone they will trace a line of fire from themselves to the anchor for it, and if there is no line of fire then they will ignore it (if you cant see the spot that is risky to be shot from). Not perfect but it would prevent units behind a wall from reacting to a hazard spot that was located outside.
So in addition for pointing out to the AI which areas are open danger areas, it also points out to the AI which areas have been made dangerous as a result of combat, which changes as the battle goes on due to its fluid nature. Big dangerous weapons like cyberdisk plasma guns or rocket launchers will get AI to avoid areas they've seen those weapons in action, if the user of that weapon is spotted somewhere else then they pose that hazard over there - but the location that they were at previously will still linger because of the buddy system (another unit may be in a position to fire from there) and because the enemy unit may swing back to that spot.
How strongly the AI curtailed its movement as a result of exposure rules - I think it should be up to the unit's Bravery, possibly a skill test in order to make it random. The AI should only do it once per turn for each unit IF they are confronted with a hazard zone.
The intelligence of the unit may also come into play in some manner, for example weighting higher ranking Hazard Anchors while ignoring the lowest tier ones if heavy duty stuff is being used, if the intelligence is high enough (ie, at least 5) then they can go ahead and reassess the target while the AI remains aware of the location of that target even if they dont have a line of sight check (predicting where the wielder of that weapon went and alerting the rest of the units of their faction)
This is a complex, dynamic way of handling "sneaky AI" at least in terms of picking which areas and targets are more dangerous to avoid.