“Before the foundation of the world” and “according to the good pleasure of his will” does not at all contradict the fact that the election is based on the divine foreknowledge of our own free will actions. What it precludes is the pelagian error, that we can purchase election in the sense of obligating God to electing us.
What it precludes is the pelagian error, that we can purchase election in the sense of obligating God to electing us.
The two underlines phrases say exactly the same thing.
If election is based on "our own free will actions" then we are "obligating God to elect us."
If we choose correctly, God must reward us -- which directly contradicts Paul in Ephesians and Romans.
God's grace through faith in Jesus Christ is a free gift, determined by God alone and not based on any work we might accomplish, but solely upon Christ's work on the cross.