This addon actually isn't that hard...
If you work with a new plugin for the hook register_addmember_process (or just find this in register.php) you'll basically need to add to get the invite code, check it and update the group.
This code will preform a basic check and move a user, you'll have to get a bit more advanced if you want to compare codes against a database table.
Code:
// parse the form field
$vbulletin->input->clean_gpc('r', 'invitecode', TYPE_NOHTML);
// check if they entered the code "secret code"
if ($vbulletin->GPC['invitecode'] == 'Secret Code'){
$userdata->set('usergroupid', '5'); // change the usergroup from 5 to whatever
}
Playing around with the code you can do other things like send a special email out, show a different thank you message and so forth.