Your problem line is

set /A math=%%N+%code%+2*2,74:2

: is not a valid operator, so SET interprets it as a variable that should contain a number. So SET sees number number, without an operator between them, and raises an error.

I have no idea what the line is supposed to do, so I can't suggest how to fix it.