I know you will.
And, as usual, this question is born of ignorance of how certain non-Catholic dogma developed, so I do not mean this question to be confrontational.
So, going back to our moderately sinful Muslim. He dies, but is saved at the last moment. Does he become part of the Elect at that point, or was he all along? Or am I completely confusing your interpretation of the Elect?
Well, the bible says (in multiple places) that God wrote the names of the elect in the Book of Life before the foundation of the world. These verses tell us clearly that election was done before any of us existed; the man's destiny was to belong to God. However, until the moment of belief/salvation, he was "dead in sin" and a child of wrath, just like the rest of mankind.
I'm a bit confused why you keep saying moderately sinful. Is that a real thing? The most significant sin of all time was a woman eating fruit. Is that a moderate sin? I don't know what a moderate sin is. Any violation of God's law brings God's complete wrath. Hence, no one approaches except though the covering of Christ.