I am unaware if there is an official way to avoid this. However, there might a workaround…
Take the dns-update code and put it into a new script. Then, call it from the first script using the undocumented :execute command (http://forum.mikrotik.com/t/resolve-failure/55310/1). Something like this:
Main script:
...
:execute script=dnsUpdate
... run checks to see if script succeeded
...
You could also just run the dns-update command in its own script and use a second script would check to see if the script succeeded and respond accordingly. People have done this with a similar Fetch problem: http://forum.mikrotik.com/t/fetch-status/51447/18
Either way, since you use variables in the dns-update command, I think they will need to be global to pass them between the scripts.