If you're able to find all of the ids for each town you're removing from the scripts and game menu by text documents, by all means do so.
But remember, for every town you remove, you'll need to find and decreasing the id for the next 20 towns, 50 castles, and 100 villages, in addition to all the bandit spawn points. It's really not worth the effort.
What you can do with the text editor is change the coordinates of the towns to some random place, as I've seen some mods do in the past. However, keep in mind that factions will still own the town, the lords will spawn there, and quests and caravans will still go there, etc. The mods I mentioned always disabled the towns first and made it so that they aren't referenced anywhere, which you'll find quite impossible to do with text editing.
And I really don't suggest making text-based mods, you'll regret it later on.