You can use the strlen command to get the length: strlen MAGICSZ MAGIC math OFFSET + MAGICSZ
The main concept of the bms/mexscript language is that it's basic and uses just one command per line, that's why a "math OFFSET + len(MAGIC)" is not possible because that would be like having 2 commands in the same line.
The reference manual of quickbms is just quickbms.txt, the file located in the quickbms package and mirrored here: http://aluigi.org/papers/quickbms.txt
It contains the full list of commands and what their arguments do. The language has been improved during the last years with some features that weren't planned and sometimes were difficult to "fit" inside the original syntax. For example the operators of the String command are far from being intuitive but they cover all the operations encountered till now during the working on file formats.