Several ways you can do this. I'd suggest a repeatedly activated trigger where activation is by the enemy side. In the 'on activation field' I'd put "markername" setmarkercolor "colorred" and in the 'deactivation field' I'd put "markername" setmarkercolor "colorgreen".
This way if the enemy should recapture the town, the marker would turn to red again, and once cleared, green again.