Stern warning to be quiet. Caustic and emphatic shut up. ‘Trap’ indicates one’s mouth (the jaw opens like a trap eh?). The term may also indicate a desire for you to not just be silent, but go away .
“The neighbor boy started to explain how my auto window got broke, but I told him to shut his trap and stay away.”