Hi Alex,
it seems to me that there is a token CODE_BEGIN="{{{" or equivalent somewhere in your grammar BEFORE the "CODE_TEXT" token that you are not showing here. If I remember correctly, Grammatica has a "first defined, first matched" rule, or maybe was it "keywords before regex matches"? What happens if you remove the CODE_BEGIN token? The triple braces are part of CODE_TEXT, anyway.
Regards
Oliver