My system is very, very crude. It doesn't actually figure out which page the person is on, it just looks for clues in the file name (e.g. if the filename is memberlist.php, they must be looking at the memberlist, etc.). If you look through the online.php, you'll see the different places I've planned for, and you'll also see where it defaults to "Browsing Board".
One thought that just came to me is you could make a list of all the vB files. From that list, remove any that I've accounted for already in the script. Then, do a big if(strpos()===false) statement with all of those names. If it's none of those names, then they're not browsing the board. However, this is also awkward. You might also try following the "clue-and-result" system. If they're looking at a page called "mail" with the variables "send=yes" then they're sending mail. That kind of thing.
Someday I'll figure out a better way to do this.

Just not today.