To be effective and well trained at engagement, optimizing decision-making, negotiation, and all of the other skills that come into being a really good Scrum master takes a significant amount of time. While it's possible to be really good at both, typically I don't see this (Also has to do with the types of personalities that generally are interested in these subjects - there is overlap but not as much as you might think).
It also depends on the scale of the project, or if the scrum master has multiple projects they are involved with (or are also tasked with seeking out new opportunities or new ways to remove impediments for the team).
Probably the classic burn-the-ship example I encounter regularly is someone taking their best developer and making them a manager. The unfortunate bit is that managers will often have a higher salary, and that this drives the incentive for developers to "go up the rung on the ladder".
So, the tl;dr is I'd focus on someone who is excellent at managing people, setting expectations, is knowledgeable in decision-making models and measuring and building a response to a complex system, and then put them through a coding training program or similar - not to be your best coder, but to have them understand the trials and tribulations that the devs will face.