That is built into the towny war by default, it's not a new idea. If nations do not want to do war they have to "pay" a wartime fee to be neutral (opting out) of wars. If town's don't want to war then just "leave" the nation, towns without nations are exempt from war.
If you would like an explanation of the suggestions on how to set up war strategy, feel free to poke me on skype/discord/Teamspeak).
During a war, Nations fight each other. Towns without a nation are not included, cannot score points and cannot have their townblocks griefed. Nations can also pay a daily Neutrality cost to avoid taking part in a war.
These are my suggestions for towny war:
Eco Settings
price_nation_neutrality: '100,000.0'
price_death_type: fixed
price_death_pvp_only: 'true'
price_death: '100.0'
price_death_town: '250.0'
price_death_nation: '500.0'
Jail Settings
is_jailing_attacking_enemies: 'true'
is_jailing_attacking_outlaws: 'false'
jail_allows_ender_pearls: 'true'
jail_denies_town_leave: 'true'
is_allowing_bail: 'true'
bail_amount: '10,000.0'
War Settings
nation_can_be_neutral: 'true'
disallow_one_way_alliance: 'false'
place_flag: '0.0'
defended_attack: '0.0'
townblock_won: '0.0'
homeblock_won: '0.0'
warning_delay: '60'
towns_are_neutral: 'true'
only_attack_borders: 'true'
healable: 'true'
firework_on_attacked: 'true'
remove_on_monarch_death: 'false'
allow_block_griefing: 'false'
town_block_hp: '60'
home_block_hp: '120'
base_spoils: '0.0'
wartime_town_block_loss_price: '0.0'
price_death_wartime: '1,000.0'
costs_townblocks: 'false'