setNexRequest just sets the request that will run after the current request and all of the code in any pre-request script or tests tab has completed.
The current request will always run.
However, saying all of that, what should happen with your example code is that it should just stop executing all requests after this is triggered. It won’t just skip a folder but all requests.
First troubleshooting step would be to put a console log just before the postman.setNextRequest method. Is the if statement actually being triggered?
“false” and false are not the same thing.
Once you’ve got the if statement being triggered correctly, you might want to look at the skip request feature which is probably what you need to use instead of setNextRequest().
This topic also discusses skipping folders.
Newman Run Issue for subfolders collection - Help - Postman Community