I now realise I've misreported this bug. Checks in my test forum - without installing your suggested code change - appear to confirm it.
Contrary to what I suggested earlier, when replying by email, if the forum has been set to "no Reply", you do get a "Delivery status Notification" with a message "Please contact the owner about permissions or visit the Nabble Support forum" (as you do with locked topics).
The bug turns out to be a little more esoteric.
In the case, on the SeaHawk forum, that prompted my report, the bug occurred because I had edited the original post's Subject line. As a result the reply came through with a different subject line to the original post and it is a documented feature that Nabble will process an email reply with a changed subject as a new topic.
Experiments in my test forum now suggest to me that this bug is more an undesirable side-effect of a "feature" which was intended to assist those folk who adopt poor email practice and expect to break threading with a change of subject line.
Probably only you can say if there is an easy way to code a test to determine if an email reply still has the original subject line in place, in which case it ought to be rejected, or whether it has an edited subject line created by the user replying and hence probably should be accepted by Nabble as a new topic.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!