I've been testing with one of my most complex applications.. 6890 lines in the module I'm testing, and the deepest level of open function pairs is 5. I'm thinking that if you need 40 levels, you're doing something wrong. 
It's interesting, because I actually found a problem in the code I'm using to test Sanity - a missing EndSelect that's been "not there" for at least 3 code revisions, so the updated Sanity certainly works.
I figure another day to polish it and it should be ready to publish. In addition to the usual checks for variable declarations and mismatched quotes and parens, it now checks for balanced If/Endif, While/Loop, Do/Until, and Select/EndSelect, including invalid sequences like If/Select/Endif/EndSelect.
Glenn
_________________________
Actually I
am a Rocket Scientist!