Season 8, Episode 16
Sideshow Bob is released from jail to go and work with his estranged brother Cecil, a hydrological and hydronamical engineer, to build a dam across a river in Springfield. When Bob saves Bart and Lisa from certain death, they help him expose Cecil as the bad guy.
There is a scene towards the end where the money and a gun fall from the sky and land next to Hans Moleman, who then picks up the gun and points it at the sky and demands the rest of the money. Hilarious, but unfortunately it ended up on the cutting room floor (it is included on the DVD's deleted scenes).
See here for details on The Simpsons Wiki.
See here for the script.
Notes & Screenshots: Lord Heath