It seems like you already have most of the calculations to do this, just need to store the calculated distances in an array or temp table and sort on that.
Sorting the results of a distance search is basic expected result. See any "store locater" type script, the results wouldn't be near as good if they worked like Classifieds.
Here's an example, try the zip search for Radio Shack stores here.
If you decide it's too difficult to provide distance sort in the "sort by" drop down list, at least sort the results that come from advanced search in the "sort by distance" section, which finds the results within a selected distance, but ironically doesn't "sort by distance" at all.