This is not the simple meaning of the words. They should be translated as "we will do and we will obey" rather than "we will do and we will hear". The same Biblical Hebrew word is used for "listen" and "obey"; the modern Hebrew word for "obey" is simply the Aramaic translation of the Hebrew word for "listen". So the idea of unconditional acceptance does not really have a source in Shemot 24:7.
In fact, one might even argue that the opposite is implied. The entire verse reads as follows: "[Moshe] took the scroll of the covenant, and read it to the people, and they said: Everything Hashem spoke, we will do and we will obey." They people declare their acceptance after hearing what is in the scroll, not before.
So if "we will do and we will hear" is not the simple meaning of this verse, what on earth is the midrash talking about?
One might say that the midrash's idea must be true on a philosophical level - perhaps your commitments can only be meaningful if you make them unconditionally, and intend to hold to them in good or bad times, without considering if at some point in the future it will be advantageous to you to betray them.
But beyond this general idea, I think we can locate many specific verses in the Torah that make the same point.
There are a number of sections in the Torah where a mitzvah or category of mitzvot is presented in detail. In addition to all the details, there are often a couple verses which summarize the section, including either a brief summary of the laws, or else an explanation of the effects and importance of keeping them. Interestingly, this summary appears not at the beginning of the section (where you might expect it), but rather, almost universally at the END of the section. Here are a number of examples:
- The Mishkan: In addition to the details of HOW to build the Mishkan, the reason WHY we build it is so that God may dwell among us. This is mentioned briefly at the beginning of the long Mishkan passage, but more fully explained near the end (why it's not at the absolute end is the subject of another essay).
- Kosher animals: This passage has no special beginning. Rather, the passage immediately starts by listing kosher and non-kosher animals. The passage ends with a "why" explanation for the laws of kashrut: "be holy for I am holy", and therefore, do not eat anything impure.
- Tzaraat: This passage has no special beginning (the first paragraph is just one type of tzaraat). The passage ends with a summary of the types of tzaraat, which is introduced by the formal heading "zot torat hatzaraat".
- Bodily emissions: This section too begins with specific cases rather than a special beginning. It ends with both a "zot torat ___" summary, as well as a "why" explanation (that Jews not "defile My tabernacle").
- Sexual sins: The beginning here is somewhat unusual in that it starts with the generalization of not doing "the practice of the land of Egypt/Canaan" - the kind of broad explanation I'd expect to find at the end. However, the end is more involved, repeating this generalization and adding both individual and collective punishments.
- Sotah: This passage has no special beginning. The end is a "zot torat ___" summary.
- Vows: This passage has no special beginning. The end has a summary of the laws.
|The Mishkan||Begins with "Speak to the children of Israel, that they take for Me an offering ... This is the offering which ye shall take of them: gold, and silver, and brass..." (Shemot 25:2). This is soon followed by a basic description of the purpose of the Mishkan: "And let them make Me a sanctuary, that I may dwell among them." (25:8)|
|But the full description of the Mishkan's purpose only appears near the end of the passage: "And I will dwell among the children of Israel, and will be their God. And they shall know that I am Hashem their God, who brought them forth out of the land of Egypt, that I may dwell among them." (29:45-46)|
|Kosher animals||Begins with "These are the living things which ye may eat among all the beasts that are on the earth. Whatever parts the hoof, and is wholly cloven-footed..." (Vayikra 11:2)|
|Ends with "You shall not soil yourself with any swarming thing, nor impurify yourselves with them, and become impurified thereby. For I am Hashem your God; so sanctify yourselves and be holy, for I am holy; and do not defile yourselves with any swarming thing which moves upon the earth. For I am the LORD that brought you up out of the land of Egypt, to be your God; ye shall therefore be holy, for I am holy." (11:43-45)|
|Tzaraat:||Begins with "Should a man have in the skin of his flesh a rising, or a scab, or a bright spot, and it is the plague of leprosy in the skin of his flesh, then he shall be brought to Aaron the priest..." (13:2)|
|Ends with "This is the law for all manner of plague of leprosy, and for a scall; and for the leprosy of a garment, and for a house; and for a rising, and for a scab, and for a bright spot; to teach when it is unclean, and when it is clean; this is the law of leprosy." (14:55-57)|
|Bodily emissions:||Begins with "When any man hath an emission [zav] out of his flesh, his emission is unclean." (15:2)|
|Ends with "Thus shall ye separate the children of Israel from their uncleanness; that they die not in their uncleanness, when they defile My tabernacle that is in their midst. This is the law of he who has an emission; and of he from whom semen goes out, making him impure; and of her who is sick with her impurity, and of them that have an emission, whether it be a man or woman; and of he who lies with an impure woman." (15:31-33)|
|Sexual sins:||Begins with "You shall not do according to the practice of the land of Egypt where you dwelt, nor according to the practice of the land of Canaan where I bring you... You shall keep my statutes and ordinances, which man keeps and thereby lives, I am Hashem." (18:3-5)|
|Ends with "So you shall keep My statutes and ordinances, and not do any of these abominations; neither the native nor the stranger living among you - for all these abominations did the men of the land that were before you, and the land was defiled - that the land not vomit you out also, when ye defile it, as it vomited out the nation that was before you. For whoever does any of these abominations, the souls that do them shall be cut off from among their people. Therefore you shall keep My charge, that ye do not any of these abominable customs, which were done before you, and that ye defile not yourselves therein: I am Hashem your God." (18:26-30)|
|Sotah:||Begins with "Speak unto the children of Israel, and say unto them: If any man's wife go aside, and act unfaithfully against him... " (Bamidbar 5:12)|
|Ends with "This is the law of jealousy, when a wife, being under her husband, strays and is defiled; ... then shall he set the woman before Hashem, and the priest shall execute upon her all this law. And the man shall be clear from iniquity, and that woman shall bear her iniquity." (5:29-31)|
|Vows:||Begins with "This is the matter which Hashem has commanded. When a man makes a vow to Hashem..." (30:2-3)|
|Ends with "These are the statutes, which Hashem commanded Moshe, between a man and his wife, between a father and his daughter, being in her youth, in her father's house." (30:17)|