ok this will create the setting from the parent. so that the home is the parent document.
if that is not good let me know it could be made that it uses the first doc in the parent as home.
insert this code below: $parent= $modx->db->getInsertId();
and before: //start of page creation, copy this...
$settings_table = $modx->getFullTableName( 'web_user_settings' ); //set the table to use
$fields2 = array('webuser' => $user['internalKey'],'setting_name' => 'login_home','setting_value' => $parent); //set the parameters to insert
$modx->db->insert( $fields2, $settings_table); // insert the parameters in the right table.
let me know if this works
Dimmy