I think you are describing what Is usually called “recursive routing”.
Check this post for more details:
http://forum.mikrotik.com/t/advanced-routing-failover-without-scripting/136599/1
Once you confirm this Is the desired result, we’ll talk of the details.
If - more generally - you are looking for automatic failover there are (IMHO) simpler methods using netwatch.