I don't believe that Lucas "learned it" from Spielberg. But maybe, whereas Lucas would have resisted such slapstick on Raiders, he facilitated it more on TOD. Maybe. But I think the hammer-in-the-head moment is genuinely funny, and very Spielbergian. Willie Scott, on the other hand, is very Lucasian, and is basically part of the trajectory of the Lucasian comic sidekick Lucas adapted from Kurosawa beginning with Star Wars. R2D2+C3P0>Willie Scott>Brownies (Willow)>Jar Jar Binks.
Nonetheless, both men were on the same page. Spielberg had just finished Poltergeist and was about to go on to make Gremlins. He was in that headspace, that sort of "Tales From the Crypt", spooky-dark-gorey-yet-funny-and-mildly-goofy headspace, and that sums up TOD pretty well.
Lucas, on the other hand, says he was going through a divorce at the time, and that's why TOD is dark. But this is factually untrue. TOD was written in 1982 and by the time principle photography started in early 1983, George and Marcia were still married.