Hi Daniel, and welcome to OpenACS!
I think there's an easier way of doing what you'd like to do. Look at the <group> tag. At least if I'm understanding what you're trying to do.
Also, I would have a look at my templating doc, at http://rubick.com/openacs
Consider joining us on IRC. Or posting back here if that doesn't help.