I have in mind gemaras such as Yoma 54b, which says, according to the interpretation of one of my rabbis, that the Even haShetiya -- the stone found under what is now the Dome of the Rock -- was the first thing ever created. Must we take this and other gemaras literally, or can we interpret them as metaphor, as is permissible to do with (other) midrash?
Ramchal - Mevo L'Sefer Haklalim (my rough translation)
The philosophers and scientists can grasp only the external surface of the world, namely, the physical world, according to what appears to their physical eyes. However, this is merely the outermost garment of the spiritual roots, namely, the sefiros who govern the world and are the innermost spirituality inside the physical... Just like the form of man alludes to the entire system of Divine governance, so too it is alluded from all the parts of nature, and every creation is an expression of one detail of His governance...
And on this are based most of the sayings of the Sages which refer to the Creation and to all matters of the world, whether in heaven or on earth and all of their derivatives, this is also a broad and important subject.
When our Sages instruct us on matters of nature and of this world, they are referring to its inner aspect - not on its external garment. Therefore, sometimes in their words we find things which appear strange, and which appear to be clearly false from what we perceive with our senses. But the truth is that they are speaking according to the true governance which is hidden from human eyes, which they received from the prophets and from the holy Torah.
sounds from here that they are not meant to be taken too literally.
No, Rambam said clearly that Aggadot Hashass use allegorical style.
I advise you to read two fragments of the introduction of Rambam on mishnayot commentary. One in zeraym introduction.
But the "literally true" question is itself an allegory, the question has several levels and the answer too cannot be yes or no.
in Zrayim Introduction :
Rambam said that Rav Ashi made four parts in Talmud Bavli: explainig the mishna; decide the law; the novelties which were found in mishna and new enactments; drash. For drash the message is secret and wrote in a way that everybody can hear it but wises only know the real topic.
He says that some people (the second group) believe that all Chachamim statements must be understood literally. He explain that they make a great damage to wises and shame to Jewish People. They are almost equivalent to the mal'igim, who ridiculize Talmide Chachomim and who are punisheb by boiling feces, dramatic expression (from the Gemara in Gittin 57b) explained below .
Here is a small extract:
והוא מה שאמרו (עירובין דף נג:) לבם של ראשונים כפתחו של אולם ושל אחרונים אפילו כמחט סדקית: וכ"ש אנחנו שהחכמה נעדרה ממנו וכאשר הודיענו הקב"ה ואבדה חכמת חכמיו ובינת נבוניו תסתתר (ישעיה כט.) יחד הכתוב כל אחד ממנו בארבעה דברים.
We consider the intelligence and the deepness of our first wises as much larger than ours. We have four great disabilities.
- בחולשת השכל.
weakness of intelligence.
- וחוזק התאוה.
strength of physical desire
- ועצלות בבקשת החכמה.
- והזריזות בבצע העולם. ארבעת שפטיו הרעים
ואיך לא נסמוך החסר לנפשותינו כשנעריך אותה עליהם. ומפני אשר ידעו עליהם השלום בענין זה שכל דבריהם ברורים ונקיים ואין בהם סיגים צוו עליהם והזהירו שלא ילעג אדם עליהם
Every word of Chachamim is clearly conceptualized and without superfluous things. To mock their words is prohibited.
ואמרו (גיטין דף נז:) כל המלעיג על דברי חכמים נידון בצואה רותחת כו'
since a Master has said (Gittin 57a): Whoever mocks at the words of the Sages is punished with boiling hot excrement.
Rambam reports and comments this dramatic phrase: ואין לך צואה רותחת גדולה מן הכסילות אשר השיאתו להלעיג.
It befits to their stupidity to be called boiling excrement best than to any other thing . ( __note that in the example itself Rambam is teaching us a method to link conceptually between boiling excrement and idiocy, making the punishment accurately linked to the spiritual situation of the punished person __v. Rav Chayim Friedlander in Sefer Sifse Chayim has large developments about the din, and discusses similar ideas based on Rav Dessler and Vilner Gaon).
So every word and every letter need to be accurately learned. But the Cavod is not to say that all is literal but that all is significant. The literal sense is very important because he has a great deal of truth, contains a great quantity of allusions.
Literal sense describes is sometimes parabolic only. E.g. in a symbolic language for addition and multiplication "+", "*", are arbitrary. Nobody thinks that to study their form will enhance knowledge about operations. Because the mathematic symbol is only a mean of expression for a precis intent.
Concerning Chachamim and Torah words, literal sense and the allegoric are interpenetrated. You can see examples in midrashim and deep sifre chasidus.