Using get_user in wordpress with sorting

I think modifying the default tables in your WordPress install is a bad idea. Generally you should never modify the database or the core code, but instead use API functions to get the desired functionality.

In this case that you be using the user meta fields to store a sort order for each user. The easiest way to do this would be to add a field to the user profile screen, here’s how I’ve done it in a plugin:

function my_user_contactmethods($contactmethods, $user = null)
{
    /* Standard WordPress fields which we don't need */
    unset($contactmethods['aim']);
    unset($contactmethods['yim']);
    unset($contactmethods['jabber']);

    /* Now let's add the new fields */
    $contactmethods['company'] = __( 'Company name', 'my_domain' );
    $contactmethods['title'] = __( 'Title', 'my_domain' );
    $contactmethods['sort_order'] = __( 'Order', 'my_domain' );

    return $contactmethods;
}
add_filter('user_contactmethods', 'my_user_contactmethods', 10, 2);

Off course you could also set the values using update_user_meta if you prefer, or if you simply don’t need the input fields. Unfortunately WP_User_Query doesn’t support ordering by meta_value like WP_Query does, but by hooking on to pre_user_query we can add this to the standard query.

function my_pre_user_query($query) {

    global $wpdb;

    $meta_query = new WP_Meta_Query();
    // This is just to construct a calid Meta Query, we dont' really run it
    $meta_query->parse_query_vars( array('meta_key' => 'sort_order') );

    if ( !empty( $meta_query->queries ) ) {
        // This requires that the users has meta_values for sort order
        $clauses = $meta_query->get_sql( 'user', $wpdb->users, 'ID', $query );
        $query->query_from .= $clauses['join'];
        $query->query_where .= $clauses['where'];
        $query->query_fields="DISTINCT " . $query->query_fields;
    }

    // This is where the ordering is applied, finally 
    $query->query_orderby = "ORDER BY " . $wpdb->usermeta . ".meta_value" . " " . $query->query_vars['order'];
}
add_action('pre_user_query', 'my_pre_user_query');

Since this will affect all user queries, only add the action where appropriate and remove once it’s not needed anymore.