OS Update Script - What am I doing wrong?

/system package update
:do { set channel=bugfix } on-error={ [] }
:do { set channel=long-term } on-error={ [] }
check-for-updates
:delay 3s;
:if ( [get status] = "New version is available") do={ install }

The purpose of this script is to update both MikroTiks that are at 6.40.9 and at 6.42.x indiscriminately.
I’ve tried this multiple ways. It continues to fail when run in terminal or run as a script. Is there something obvious I am missing? Any suggestions?

/system package update
:do { set channel=bugfix } on-error={ set channel=long-term }
check-for-updates
:delay 3s;
:if ( [get status] = "New version is available") do={ install }

Figured it out. The settings needed to be contained in a string

/system package update
:do { set channel="bugfix" } on-error={ set channel="long-term" }
check-for-updates
:delay 3s;
:if ( [get status] = "New version is available") do={ install }