I mentioned before the idea of the Ten Commandments being hidden in the Ten Statements of Creation. [Nine times "And God said" and the first verse "In the beginning God create heaven and earth" which was the first statement but since it doesn't say "God said" it is the hidden statement ] These Ten Statements are hidden inside all things that have been created. But the light of the Torah in them need to be revealed. Avraham paved the way so that later the ten plagues would bring forth the light of the Ten Commandments. This is the hidden reason for the Rambam seeing in Physics the highest\ light--the light of the hidden statement of Creation.
Clearly this has a relation to ten types song that are mentioned in the Tikunai HaZohar and also in the Tikunim of the Ramchal. That is the fact that the light of God does not extend to unclean places as it "My glory I will not give to another." So from where does an unclean place get it's life force? From the Hidden Statement of Creation. But for that to be revealed, one needs the ten kinds of song.
My original point was however more along the lines of why God wrote the Torah in this way? What lesson is the story of Avraham's going down and Sara being held prisoner and then being redeemed?
[The connections here are based to some extent on Reb Nachman]