A couple of comments if I may ....
besides the 'official' mirrors, and also of course the PASS repository, I would have in my sources list some entries which may look like these
Should I have any or all of those in my sources list I would certainly not be happy if they were removed.
Most users I should imagine would prefer to use the Synaptic GUI to administer their sources list (if they so choose) rather than edit the file themselves.
If I have previously edited my sources list and reduced the number of entries to mirrors in my locality (for instance) then it would be very useful to know which of those may be having trouble and slowed, so I could drop it down the list.
So, yes, this script I find very useful indeed.
I would even say that I would use it to change my sources list from the mirror selection, but I would never wish it to interfere with my personal entries in the list.
I guess the difficulty is to go through the process and even write the new list, without changing the personal entries in the list.
There are probably several ways to work around the problem ....... such as compare the present list with the official mirror list, and present the differences to the user to allow those entries to be retained.
That would allow the user to retain whatever he wished, while still getting the option to choose a number of the faster mirrors to be ADDED to those retained, at which point the sources list could of course be written anew.
It is that flexibility - to retain specific entries - and to choose then from the others, that I think would help those of us with personal entries in the sources list.
The option to write the list could then be presented to the user .... accept or exit the script, and if accept to write the list a request for the root password to allow it to happen.
I realise most of what I have written has already been covered. I did not mean to imply otherwise.
I just wished to suggest a method by which my particular situation might be covered.