Just a small optimization:
Replace
PHP Code:
if (!isset($legend))
{
$legend = $group['opentag'] . $group['title'] . $group['closetag'];
}
else
{
$legend .= " | " . $group['opentag'] . $group['title'] . $group['closetag'];
}
With
PHP Code:
$legend .= " | " . $group['opentag'] . $group['title'] . $group['closetag'];
This is safe to do because vBulletin unsets all the globals in init.php...
Other than that - nice job