Here is a bookmarklet to sort your contacts in the hipchat web app.

Right-click and bookmark or just drag&drop this link to your bookmarks:
sort hipchat contacts

Source:

hcsli=jQuery('li.hc-person');
hcsli.sort( function(a,b) {
                return jQuery(a).find('.room-name').html().localeCompare(
                       jQuery(b).find('.room-name').html()); 
            }
);

jQuery.each(hcsli, function(idx,itm){
     jQuery('.aui-navgroup-inner').find('div:last ul').append(itm);
});


This is a patch for the hipchat desktop client.