Scripting in routeros is not optimized in some important cases. When error occurs, script just stops without logging when and why and further commands were not executed. Most noticed that. If script has error when flashing with netinstall, happens that entire script fails to load. These errors mostly appears because of routeros version changes. I.e. wireless restrictions, bridges. Even upgrading older routers, they can't execute default script after reset. I have no idea how to upgrade routers and make them work after reset, if script tries to execute commands, that newer routeros do not understand. I guess there are no ways to solve that yet. I think there should be option to ignore only specific error and execute current line without bad command (i.e. interface wireless dfs-mode= was removed in routeros, but was used in script).
Another example I can't solve: I want to make one script for several models. One has poe-out, other don't. And I need to disable poe if it exists. So command:
/interface ethernet set [ find default-name=ether5 ] poe-out=off
can be executed if ether5 has poe-out, but if it don't, poe-out can't exist in command line. Are there any ways to make command work on both models?