Intro to assigning tag fields with scripting on Mac

The headline claims something different from the actual example.
The example assigns "Beatles" to ARTIST and "Yellow Submarine" to TITLE.

There are many ways to skin a cat - but I think that the action of the type "Format tag field" is a little easier as you can select the target field from a list of fields.
See also the documentation:

You are right: use the Actions if you want to keep the script definition.
Some actions like "Replace" are one-offs in many cases, so it may not be worthwhile to save the configuration. But that depends on the use-case.