Day 2 and ready for another post
Anyhow this is something i done awhile back for vBulletin. For those whom use cyb - chatbox may see this useful its only the gist of things to make custom commands since cyb lacks on it Anyhow here is a /ban one limited to 15 lines so this is gist

PHP Code: 
$vbulletin->GPC['ccb_newmessage'] = str_replace('/ban '"".''$vbulletin->GPC['ccb_newmessage']);
$banuserthis $vbulletin->db->query_read("SELECT user.username, user.usergroupid, user.displaygroupid,user.userid FROM ".TABLE_PREFIX."user WHERE user.username = '".$banusername."' AND user.userid !='".$banusername."'");
$banuserthisone $db->fetch_array($banuserthis);
$lists explode(',',$vbulletin->options['cybchatbox_excluded_users']);
$userid $banuserthisone['userid'];

$cybcb_banuser $vbulletin->options['cybchatbox_excluded_users'].','.$cybcb_usertoban;                
$cybcb_banuser str_replace(',,',',',$cybcb_banuser);                          
$cybcb_banuser trim($cybcb_banuser',');
$vbulletin->db->query_write("UPDATE " TABLE_PREFIX "setting SET value = '".$cybcb_banuser."' WHERE varname = 'cybchatbox_excluded_users' "); 
Basically once /ban {username} is executed, it'll select that user off the DB and ban that user following the correct order from , in the vBulletin options for cyb ban section is. Have note this is not the full code upon it, its just the gist upon it so hopefully it can help for those whom like to make their own commands I done this off the top of my head
(I may post the full code not sure though)