I believe any civilian leader would have done very similar i.e. sided with US, so I don't believe it was genius of Musharraf to side with US and buy some time for Pakistan.
A civilian leader couldn't have turn army against Talibans. Only an army personal could do it successfully.