Were people aware of echolocation in whales (or other species, like bats) prior to the advent of modern technology? If so, what did they understand about the process?
Humans developed echolocation technologies (in particular, ASDIC or active sonar) before the existence of animal echolocation was understood. We can say that research into the basic echolocation of principle of sending out a pulse of sound and then waiting for its echo to return in order to detect objects began in 1912 as a potential means for detecting icebergs, then became urgent during WWI for submarine detection and was become usable as the war ended in 1918. This research continued and the technology was widespread in military applications when the WWII submarine campaigns began in 1939. The analogous technology of radar had been developed by this time as well.
Bat echolocation was confirmed just before WWII, in 1938. Before bat echolocation was understood, humans had known for centuries that bats had an amazing ability to navigate in the dark. Experiments ruled out other mechanisms such as extremely keen vision or a highly developed sense of touch on the whole body. Rather it was a sort of "sixth sense." There was rampant suspicion in the early 20th century that hearing was involved. In 1938, American researchers Donald Griffin and Robert Galambos confirmed that bats were emitting ultrasonic sounds (i.e., too high-pitched for human hearing) and in the following few years confirmed that this was the mechanism for navigation. By this time we should note that humans were using radar and sonar (as well as passive sound systems like those used for locating enemy artillery and hydrophones or passive sonar for detecting ships and submarines), so the concept of using some hidden beam of energy to explore the world was easier to understand.
Much less was known about cetaceans' use of echolocation simply because their undersea lives were much more mysterious. We simply did not know precisely how deep they ventured, what the environment was like there, and whether they did anything extraordinary like bats that would require a "sixth sense." The various sounds made by cetaceans were also largely unknown until WWII, when a great many ears were directed toward the ocean. William Schevill, a paleontologist before the war, a physical oceanographer during it working on sonar, and a cetologist at the Woods Whole Oceanographic Institution later (you can probably guess he is a key player in this), noted that during WWII a great many people had been listening to the sea and heard many sounds whose significance they did not understand. They were just "fish sounds" as far as anybody knew. Maybe they were for communication.
I would therefore reject the idea that the bare fact sperm whales can make very powerful sounds would have told anyone to look for echolocation. That really only makes sense if you already know what echolocation is and can come up with a use case for the sperm whale. Neither of these things really existed until after WWII. So very little was observable and it did not point to echolocation.
The first suspicions about cetacian echolocation came from post-WWII captive bottlenose dolphin studies at Maine Studio (later known as Marineland of Florida). The curator, Arthur McBride, observed that the dolphins were able to avoid nets flawlessly despite dark or murky conditions. Like they would effortlessly head for the hole in the net despite zero visibility. This pointed to a "sixth sense."
By this time both sonar and bat echolocation were known, and there were lingering suspicions about those "fish sounds" heard during the war. It was easy to devise a set of experiments to confirm that the dolphins were using echolocation. This explained at least in part the clicking sounds that dolphins seemed to make constantly: they were the pulses of sound for the dolphins' echolocation. McBride and Schevill, who had been doing a lot of listening underwater, coauthored a 1956 article outlining their suspicions and findings about dolphin echolocation.
After dolphin echolocation had been described--and was subject to intense study funded by the U.S. Navy--these and other scientists looked at other whales and hypothesized that they, too, were using echolocation. I believe Schevill and his WHOI colleague William Watkins are credited with first describing echolocation in great whales in 1966. Note that sperm whale echolocation was regarded as controversial at least into the 1990s and I believe the function of the spermaceti organ is still debated. The theory that it is part of the whale's echolocation system was apparently first published in 1970 (lead author Ken Norris then of UCLA, who I think was also at Marineland in the 1950s with McBride and Schevill) but there are still competing explanations. By this point it was clear that sperm whales found prey where there was no light, so the use of echolocation would explain how they did it, much as for bats and dolphins.