Here, "Egypt" refers to the people of Egypt. Alternate translation: "Yahweh will afflict the people of Egypt" (See: [[rc://en/ta/man/translate/figs-metonymy]])
The word "them" is understood in this phrase. Alternate translation: "afflicting them and healing them" (See: [[rc://en/ta/man/translate/figs-ellipsis]])
How this phrase relates to the phrase before it can be made clear with the words "after" and "also." Alternate translation: "and after he afflicts them, he will also heal them"