Freeze specific bones?

So im making an addon where you raise your arms, by modifying the bones, but when walking the arms flop around like crazy, is it possible to make it so that bone doesnt move when walking?