When omniscient God had a plan for Jesus, why did God think of killing everyone? There seems to be a contradiction between these two verses. 


  So the LORD said, "I will wipe from the face of the earth the human race I have created--and with them the animals, the birds and the creatures that move along the ground--for I regret that I have made them."
  Genesis 6:7 
  
  “He paid for you with the precious lifeblood of Christ, the sinless, spotless Lamb of God. God chose Him for this purpose long before the world began, but now in these final days, He was sent to the earth for all to see. And He did this for you.”
  1 Peter 1:19-20


In Genesis, God judges mankind and destroys them, seemingly thinking that will fix them. In 1 Peter we're told that salvation through Jesus was the plan since the very beginning. So the motivation for the flood doesn't make sense in this light. 

How is this apparent contradiction typically explained?
There really isn't any contradiction between the two Scriptures, their divergence is simply a small look at God. 

God is shown in the Old Testament as the God of second chances, and in the New Testament as the God of grace. 

In the Old Testament what we see is God continuously  allowing mankind the opportunity to repent and return to the God of creation; and in the New Testament what we find is God in his final frustration reducing the penalty for sin to acceptance of substitutionary sacrifice.

In the books of Exodus and Leviticus and to a certain extent the book of Deuteronomy; we find God giving the Nation of Israel an opportunity for redemption through substitutionary sacrifice. Even though God did extend that redemption, to the Nation of Israel we see that the physical adherence to that system was more than weak humanity would sustain.

All that we need to know about how history and God's plan is covered in Chapter 20 of the Gospel of Luke:


  Luke 20:9 through 16 KJV  Then began he to speak to the people this parable; A certain man planted a vineyard, and let it forth to husbandmen, and went into a far country for a long time. 10  And at the season he sent a servant to the husbandmen, that they should give him of the fruit of the vineyard: but the husbandmen beat him, and sent him away empty. 11  And again he sent another servant: and they beat him also, and entreated him shamefully, and sent him away empty. 12  And again he sent a third: and they wounded him also, and cast him out. 13  Then said the lord of the vineyard, What shall I do? I will send my beloved son: it may be they will reverence him when they see him. 14  But when the husbandmen saw him, they reasoned among themselves, saying, This is the heir: come, let us kill him, that the inheritance may be ours. 15  So they cast him out of the vineyard, and killed him. What therefore shall the lord of the vineyard do unto them? 16  He shall come and destroy these husbandmen, and shall give the vineyard to others. And when they heard it, they said, God forbid.


Let's take a look at what Jesus explained in relation to your question;


  Genesis 6:7 NKJV  And the LORD said, I will destroy man whom I have created from the face of the earth; both man, and beast, and the creeping thing, and the fowls of the air; for it repenteth me that I have made them. 


This Scripture is revisited in:


  Luke 20:13  Then said the lord of the vineyard, What shall I do? I will send my beloved son: it may be they will reverence him when they see him. 14  But when the husbandmen saw him, they reasoned among themselves, saying, This is the heir: come, let us kill him, that the inheritance may be ours. 15  So they cast him out of the vineyard, and killed him. What therefore shall the lord of the vineyard do unto them? 16  He shall come and destroy these husbandmen, and shall give the vineyard to others. And when they heard it, they said, God forbid.


And if we consider:


  Genesis 6:8 KJV  But Noah found grace in the eyes of the LORD. 


What we find is that that is exactly what God did He destroyed the evil mankind which he had created and gave the World to another in the person of Noah and his posterity.


  1st Peter 1:19 and 20 KJV  But with the precious blood of Christ, as of a lamb without blemish and without spot: 20  Who verily was foreordained before the foundation of the world, but was manifest in these last times for you,


Since in your question you have acknowledged God's omniscience I will forego that explanation, even though it is cogent to the rest of this explanation.

God knew exactly how each person would react throughout time when He began creating the Universe, and in his great love salvaged a small part of his creation through the cross.


  Revelation 21:1 and 2 KJV  And I saw a new heaven and a new earth: for the first heaven and the first earth were passed away; and there was no more sea. 2  And I John saw the holy city, new Jerusalem, coming down from God out of heaven, prepared as a bride adorned for her husband. 


And the final part of God's plan appears in:


  Revelation 21:3 KJV  And I heard a great voice out of heaven saying, Behold, the tabernacle of God is with men, and he will dwell with them, and they shall be his people, and God himself shall be with them, and be their God.


The implication of the comparison above is that:


  John 3:14 through 17 KJV  And as Moses lifted up the serpent in the wilderness, even so must the Son of man be lifted up: 15  That whosoever believeth in him should not perish, but have eternal life. 16  For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. 17  For God sent not his Son into the world to condemn the world; but that the world through him might be saved.


This is the consensus of the serious Bible students with which I have had the pleasure of associating over the years.

Hope this helps.