1.) Use the built in Netwatch functionality of the MikroTik to handle a basic script for enabling/disabling routes.
2.) Make your own more complicated script to do the same thing, gives you more control of the functionality itself.
3.) Use the script-less method, this has been posted on multiple times.
All of these things are here in the forum, and there are also examples in the wiki that will get you pointed in the right direction.