Yes, the sonic assault weapon was ported over from The Dark Knight Returns, but in the internal logic of the film it made little sense. We'd literally just seen an extended montage of Bruce Wayne preparing the Kryptonite to turn it into a weapon he knows works against his God-like opponent, and yet he still wasted time setting up booby traps he knows wouldn't have any effect. It seems to have been another case of Snyder including moments that looked good, without considering the narrative effect (or the cumulative impact on run time), and the result was another flabby sequence that made Batman look a bit dense.