I've added an implementation of endblock into the code. I stuck with endblock because it feels more familiar, and avoids potential confusion if there are more COMMAND/endCOMMAND statements added down the road. It can easily be changed if consensus says otherwise.