I would not go so far as to say that middle knowledge is required by this text, but the text is certainly consistent with middle knowledge. Stating the predicate of a counterfactual (e.g. if ~X then ~Y) would either require:
A. Tremendous familiarity with the people/circumstances involved
B. Middle knowledge, which is just a special case of A
Alternatively, Jesus could be speaking in hyperbole here, essentially indicating that the wickedness of Chorazin, Bethsaida, & Capernaum exceeds that of Tyre, Sidon, & Sodom. Wait - would Jesus really speak in hyperbole?? See Matthew 5: 29-30 -- if that's not hyperbole, the Gospel of Matthew is a pretty scary document.
How did He know this--from His own knowledge or by revelation from the Father? The text does not say. Matthew 24:36 may give a circumstantial case in favor of the latter, but we are not given a certain answer.
This is a challenging question to answer hermeneutically. I have a theological answer to this question--let me see if I can toe the line appropriately between the two.
Of course, if the passage is intended as hyperbole, question 2 is moot. Let's address question 2 assuming the passage is not hyperbole.
Sodom gets slightly different treatment here than do Tyre & Sidon. Of the three (so far as we know), only Sodom was destroyed by fire from heaven, and the text doesn't say that Sodom would have become righteous. Maybe they would have become righteous...or maybe they would have remained wicked, but not so wicked as to merit destruction. Recall Genesis 18:32 indicates that if just 10 righteous people could be found in Sodom it would be spared:
32 And he said, Oh let not the Lord be angry, and I will speak yet but
this once: Peradventure ten shall be found there. And he said, I will
not destroy it for ten’s sake.
So sparing Sodom doesn't necessarily mean massive repentance in sackcloth and ashes. Tyre & Sidon did eventually receive the gospel (see Acts 10).
Let's consider a thought experiment: Saul is converted on the road to Damascus and makes a substantial change in his life. Luke is at pains to point out that this happened after Saul witnesses the stoning of Stephen. Would Saul have converted so readily prior to this time? We don't know, but I believe it is fair to say--assuming middle knowledge as question 2 requests--that God knew when the right time for Saul to change his life would be, otherwise why wait? Why not give Saul the vision sooner before he had committed as much persecution? Apparently, there was an optimal point in Saul's eternal journey for him to come to repentance.
Destruction from God
Some have questioned God's love and mercy given the destruction wrought upon various groups of people, the Canaanites being a commonly cited example. But let's go all the way here, forget the Canaanites, what about the flood?? I'm not going to try to tackle that one in depth here (others have already done so, e.g. here), but will offer an observation that assumes middle knowledge.
If God knew that people would not repent, or that they would temporarily repent and then fall back into sin, He (and He alone) would be in a position to determine that no additional chances in mortality should be granted. Some have suggested that the flood was merciful because it stopped a world in which people would grow up with no chance to live a righteous life. I don't know if that is true, but it is consistent with middle knowledge.
Belief vs. faith
John 6 records a notable incident in Jesus' ministry where people had followed Him because of the miracles--but then had turned away when He taught hard doctrine. Apparently, believing on the basis of miracles is not enough--would Tyre & Sidon have followed this path--a path of tepid belief but never sincere faith? Possibly, but we aren't told.
The testimony of Peter
I'll try to tie some threads together here--this will probably be the least popular portion of my post. I argued above that God knows the best possible time for a person to gain a testimony and repent. In some cases, we are not told what opportunity (if any) a group of people were given to learn the gospel, but in the case of those who died in the flood, we do get this insight from Peter:
18 For Christ also hath once suffered for sins, the just for the
unjust, that he might bring us to God, being put to death in the
flesh, but quickened by the Spirit:
19 By which also he went and preached unto the spirits in prison;
20 Which sometime were disobedient, when once the longsuffering of God
waited in the days of Noah, while the ark was a preparing, wherein
few, that is, eight souls were saved by water. (1 Peter 3: 18-20)
For for this cause was the gospel preached also to them that are dead,
that they might be judged according to men in the flesh, but live
according to God in the spirit. (1 Peter 4:6)
Some understand 1 Cor 15:29 & Isaiah 9:2 to be teaching the same principle. Salvation is to be offered to all whether in this life or the next (doesn't say all will accept it). Some in the days of Noah apparently had no such opportunity in life.
A full theological treatise would be needed to unpack that idea (see a discussion on SE-Christianity here)--but a few of my related, unorthodox ideas are on this site here, here, and here.
If an omniscient God knows the optimal point in a person's eternal journey for them to come to repentance, I must conclude that it is possible for an omniscient God to withhold a miracle, even if the miracle would produce (some) desirable results.
Judgement occurs after the resurrection. If one person's path in preparation for judgement day is different from another's that's a matter for a God with middle-knowledge to decide, not me.
This is neither an excuse to sin nor a reason to halt the process of what one is becoming:
47 And that servant, which knew his lord’s will, and prepared not
himself, neither did according to his will, shall be beaten with many
48 But he that knew not, and did commit things worthy of stripes,
shall be beaten with few stripes. For unto whomsoever much is given,
of him shall be much required: and to whom men have committed much, of
him they will ask the more. (Luke 12:47-48)
That means giving a sign to someone who won't appropriately act upon it would hurt them even more than withholding the sign. A God with middle knowledge knows how much to give, how much to require, and when to do it.