How to sort all the papers referenced by a given paper by citation count?
Microsoft Academic provides an option to sort references of a paper by citation count. I am not aware how complete or accurate it is, but you could try it out. They also seem to provide an API for automated access.
Screenshot of an example for reference:

Note: I am not affiliated with this service.