A pope is not bound by the laws of the Church, but he is bound by the laws of God. Abortion is against the law of God. Therefore, a pope who participates in an abortion would be guilty of sin and would be judged and punished by God. However, he would remain pope and would continue to hold all the rights and privileges of the papacy. He would incur no excommunication because excommunication is a penalty imposed by Church law, not by the laws of God. There have been popes who committed murder and adultery. Consider Pope Leo X, who led a publicly sinful life that contributed to the break of Luther from the Church.
If one of us participated in abortion, we would not only be punished by God for breaking the 5th commandment, but we would have the additional penalty of excommunication placed on us by Church law. The pope, on the other hand, would only incur the former, but not the latter, because he is not subject to Church law penalties.
Does this help?