Therefor magic does not represent madness, but is sometimes a metaphor for something else, such as Elsa having to hide her identity, in the closet sort of speak, and then later "come out."
Magic also represents our desire for empowerment, i.e. to be able to do more than we are currently capable. However, this desire to do more actually advances us as a species. Some things that would have seemed almost magical in the world of Star Trek 50 years ago have come into existence, or may yet still come to pass.