O.K. I'm a little closer to a solution.
Instead of using a sentinel value inside the switch I check the index of the section to see which itteration I'm on. The problem now is how to close my table. Currently the </table> appears regardless of the <table> tag. This can create some dandy layout problems. Is there a way to check if I am on the last itteration of a section, or a way to set a sentinel variable inside a section so I can tell if its code was run?
Here is the code I am currently using. If someone else has a better way of listing related objects I'd love to hear it.
Here is the working code to create a related object table, allowing you to relate articles without adding any objects to the article itself. Just add the related item and the code will take care of the rest. Use the section exclude to eliminate classes which are related for inclusion in the reference article.