I suppose with a powerful enough scripting engine you could do almost that... not really run outside C++ programs or anything, but write your own "external" programs in the scripting language based on "hooks" in the game:
Code:
// the "hook" is the function name CalcDamage
// calculates damage of a ground combat attack
function CalcDamage(Weapon weapon, Troop attacker, Troop defender, Planet planet)
{
integer range = attacker.rangeTo(defender);
// no damage if out of range
if (range > weapon.maxRange) return 0;
// get weapon type from a modder defined attribute list
else if (weapon.attributes["WeaponType"] == "Projectile")
return weapon.damageAtRange[range] - planet.atmosphere.density * coefficientOfDrag;
// projectiles affected by drag
else if (weapon.attributes["WeaponType"] == "Beam")
return weapon.damageAtRange[range] - planet.atmosphere.density * planet.atmosphere.composition["Hydrogen"]
// beams must be powered down when there is volatile hydrogen!
else if ... // more weapon types and interesting code
else return 0; // failsafe in case weapon type is invalid
}
(Please note I'm completely speculating on the syntax of the scripting language; I'm just assuming it's going to look vaguely like C or Java - for all I know it could be Lua

)
edit: sorry Atrocities!
