Some building blocks already available:
http://jedmodes.sf.net/mode/filter-buffer/filter-buffer.sl
Hide/Show lines based on regular expressions (uses pcre).
http://jedmodes.sf.net/mode/folding-keypad-bindings/folding-keypad-bindings.sl
Use the Number-Block keys for (un)folding and navigation.
* a fold mode based on underlined section headings (according to the
reStructuredText syntax).
This way you can have a custom structure with nice (and understandable
to all) comments.
http://jedmodes.sf.net/mode/rst/rst-outline.sl
Outline/Folding using reStructuredText section headings as markers.