I just created a raw *:*: { ... } script with a few lines, all of the form:
if ($numeric == 369) { echo -s RPL_ENDOFWHOWAS }
(nice, easy cut and paste and regex sub). That line (for 369) is on line 155 (including a couple of comments and a few blank lines).
All seems to work without a problem.
You might want to move it around in your script (or just throw in some echoes) to identify the line where the problem occurs.