Q. Why is the bracha on the amida of Atta Chonen, on which we pray for wisdom and understanding, be said before the bracha of Hashivenu Letoratecha or returning and keeping the Torah? Should not the observance of the Torah and mitzvos have priority?
A. Talmud (Megila 17b) explains the reason why the brocho on teshuva follows the one on wisdom, based on the posuk (Yeshayahu 6: 10) "And his heart will understand, and then he will repent and be healed." As Rashi explains "They will understand with their heart, and return to Me, and this will be their cure."
Wisdom will grant a person the will, humbleness and opportunity to do teshuva and also will direct him on the way to follow. (See Mishna Berura 115: 1).
It is also the power and holiness inherent in Torah learning that will prompt and bring a person to do teshuva.
Our sages teach in regard to why havdalah is recited on Shabbos end, in this particular brocho, because if "ein daas, havdoloh minain," without wisdom you cannot recognize and tell the difference between Shabbos and weekdays. The same principle is essential in performing teshuva.
It is interesting to note that of all the middle blessings, the only one that begins with a praise to Hashem first is "atta chonen." All others start with a supplication.
The reason may well be that in order to be successful when using our wisdom and understanding, is when we know and appreciate that it is a gift from Hashem, and only when it follows His will, it has meaning, future and opportunity.