"Problem": Player units can bypass CQB by retreating 1 space then firing. All units retreat too easily from CQB. In general melee is more dynamic in chit/mini wargames due to its ability to suppress and disrupt. Melees are glass cannons, which is fine but limiting. (Melee is already awesome with energy+stun+bleed)
Solution 1: Stepping away from adjacent ____ enemies is not allowed.
____ could be CQB-capable, or TUs>50%, or nothing, etc it's not important.
Possible using scripts? All it seems to require is SelectMoveSoundUnit, getting original position, getting position of all enemies, and move prevention.
Problem: AI might try and fail to retreat infinitely.
Solution 2: AoE CQB
Possible using scripts? Probably not.
Solution 3: Melee causes debuffs which discourage retreating, such as TU drain.
Possible using scripts? Only if there's a way to make a miss cause debuffs, or melee is high-accuracy low-damage.
Problem: AI might still try to retreat with their tiny TUs.
Solution 4: Melee gives armor/resistances instead of CQB
Possible using scripts? Yes, as XCOMfiles shows you can have items give armor if they are in cerrtain slots.
Problem: Obviously players will swap to melee at end of turn. Oh yeah, and it's unrealistic.
Possible solution to problem: Make melee weapons big. Have armor adjustment only apply if they had the melee weapon equipped the entire turn using scripts.
Solution 5: 1 free melee attack per turn to buff hit-and-run.
Possible using scripts? Well it requires a melee attack trigger so maybe not.
Problem: AI might not use it.
Solution 6: No-scripts. Flashbangs, stealth, smoke, higher HP in general.
Problem: Limiting, generally doesn't hold in the lategame.