First of all - a common mistake is recognizing whether button blocked or not by player's animation/decals/etc. All that done on the client's side while on the server side only actual button state is altered. Your code will block "the bullets" but not the animation etc.
Also it's not a good idea to block player's entity from thinking neither it's necessary (at least in this case).