I agree with SRUJAconscience that the stories found in the puranas could all be allegorical and may be have abstract and deeper meanings. When it is said that the devas reside in heaven it may refer to atmospheric phenomena involving the five elements. These stories are told to create awareness about the importance of nature and its elements and to protect and preserve them for posterity. Scholars(read sages) presented these ideas in the form of stories since laymen cannot understand the science behind them and if they start taking science classes it would have neither been understood nor been followed.
For instance, a verse from Rigveda refers to Raahu as 'Svarbhaanu' and says that when he engulfed the Sun by his shadow, the people were stunned. The word 'Svarbhaanu' can be split as 'Svaha'+'Bhaanu', which means 'Self' and 'the Sun', meaning that the eclipse is caused by none other than the Sun himself and Raahu is said to be the shadow-planet (Chaaya Graham). Shadows can be perceived only through light and Sun is the source of light. When Moon obstructs the optical path of the Sun's rays from reaching the earth, 'Raahu' is created and perceived through Sun's rays. The most interesting part is that the loci of this shadow can be visualised as an enormous snake 'swallowing' the Sun. Likewise each metaphor can be explained. Even Shiva's cosmic dance explains the various levels of manifestations of harmony in nature as it refers to the rhythmic energy dance of subatomic particles and conquering 'Apasmar' is the reference to getting rid of ignorance and getting enlightenment by meditation.
Indra's battle with Vritra is also has been explained by some environmental research scholars thus:
Vritra could be a huge whirl of dense clouds laden to the brim with saturated moisture, encompassing the mountainous regions, freezing all the surface water resources and preventing rainfall and so there was no clear weather and the region became devoid of solar radiation, for months together. The inhabitants residing at the foot-hills depended on water from rivers like the Ganga, Yamuna, Saraswathi, etc., which originate from melting of the Himalayan glaciers. If there was no insulation and the temperatures drop to sub-zero temperatures, the inhabitants of the region would not be able to survive without water for drinking, cooking,etc. They cannot do their sacrificial rites also because Sun is not directly visible and sacrificial fire cannot be lit in the altar due to freezing temperatures. So it could mean Vritra tortured the sages by destroying their yagnas. But Indra, the mighty thunder cloud used a weapon made of foam drawn from the sea and killed Vritra, which could mean that the dense 'Vritra' clouds were dispersed by the formation of thunder storm 'Indra' clouds, which originated from the sea due to evaporation by the Sun, providing the required condensation nuclei to the Vritra clouds, facilitating them to produce precipitation. Thus Indra, aided by Vishnu (in this case the name Vishnu may refer to the Sun, who is sometimes referred to as SuryaNarayana) provided the requisite condensation nuclei (sea-foam weapon) and required temperature to melt the thickly frozen moisture accumulated in those Vritra clouds by means of their thunder bolt (vajrayudam) and effected rainfall which melted the frozen glaciers and released the rivers for the suffering humans.
Thus there are many interesting interpretations to various events described in the scriptures, but it will have more impact only if told in the form of such stories. Indra is also referred as mind in charge of indriyas in each individual as SRUJAconscience has said and there are many hidden meanings in our scriptures, but we are unaware of them. So I feel we cannot sit in judgement of who is wrong or who is right without understanding the hidden meanings and symbolisms and only hope that those energies which benefit the universe like Rain, Sun, Moon, Agni, Vayu, Varuna, etc. are good for mankind and those that disrupt these energies thus causing suffering to us are referred to as asuras.
Sorry for the long post 😊