It would have to unless you find a way to just find the userids in the thread/on the page and then cycle through a bunch of checks for each post. It almost sounds more server intensive to do it that way. But I could be wrong. It is only 7 AM after all.
I would think that you are right about the loop though. You'd need to put the block of code in the loop...
PS. I guess use $post['userid'] instead of bbuserinfo. That would be an obvious overlook on my part.