So, as it happens I just made something sorta like this for Ludum Dare in JavaScript. It's got a few differences from the traditional RTS, like none of the structures you place directly attacks the enemies, but I think it's clear that such a thing would be quite doable. Here it is if you want to play it.
http://www.swordsandsoldiers.com/