Here is a program that will show only the begin/end statements. Including:
CD_POPUP_OBJECT/CD_End_Object
Object/End_Object
Function/End_Function
Procedure/End_Procedure
Case Begin/Case End
While/End
Repeat/Loop
Begin_Transaction/End_Transaction
For/Loop
Begin_Constraints/End_Constraints


It will spot an object declaration inside of a Procedure or a Function.
It shows nested levels, and line numbers.
Here is a sample printout:
temp1.txt
Here is the view to download:
FindEndMatch.vw

Any comments or suggestions is appreciated.