In the $params array, the parameter "client_group_id" is missing and the paramaters:
'document_root' => $documentroot,
'php_open_basedir' => $php_open_basedir,
are obsolete as they are set by ispconfig now automatically. client_group_id is the sys_groupid of the website or in other words, the groupid of the client or reseller that owns the website.
A function to get the next webID is then not needed anymore I guess as all variables relating to the webID are now set by ispconfig.