%exitrep does not immediately terminate %rep. Attached is a log which shows a simple test case, and the status of the bug for three NASM versions. (Note that "prnasm" here is a build of the preprocessor-rewrite branch.)
Log of a test case showing the incorrect %exitrep handling
The current version doesn't appear to have this problem. You may want to try the latest release version and/or the latest snapshot from http://www.nasm.us/.
preproc-rewrite, which doesn't suffer from this bug, has been merged into the main/master branch and tagged as NASM 2.10rc2.