I agree on above replies, but to answer OP question
:do {
/system/script/run script-with-syntax-errors
} on-error={
:put "script run error"
}
P.S.
Not related to this topic, my favorite MP scene which always comes to my mind on my job when incompetent people defines how something works
https://www.youtube.com/watch?v=H9PY_3E3h2c