This is a short video of the auto-territory functions I've coded into Company of Heroes for use in Europe in Ruins. There were some basic auto-territory functions included in the designerlib.scar file included with the game however what I've written is both faster and works with unlimited number of players.
If a territory is controlled by the enemy, you can't take control until all their units are eliminated from the sector, either by moving out of it or death; then you must wait the capture time which is configurable (currently set for 5 seconds for testing).