Hi Brandon,
Yes, a mutator is the correct way to handle this. It sounds like you are already familiar with custom blocks, which is good.
In short, mutators let you add custom serializable state on a block. You'll need to
define `domToMutation` and `mutationToDom` functions, which will be called when serializing and deserializing the block. The serialized block will include a <mutation> section. The exact contents are up to you, since you're writing code that both creates and consume it.
Here's an example for the if block:
<block type="controls_if">
<mutation elseif="1" else="1"></mutation>
</block>
You'll also need to decide how the user adds and removes clauses. The built-in blocks use the UI with the gear and a bubble with a small workspace. This isn't required to use mutators--it is simply one implementation. By contrast, the
blocks-plus-minus plugin uses inline plus and minus signs.
I suggest reading through the documentation that I linked and then taking a look at the code for the plus-minus plugin.
Cheers,
Rachel