NOT a good idea... hanging should not feel painful, if it gets painful your dick is either fatigued to death or you don't have a proper technique. You also have to consider that hanging is only effective if done on a regular/daily basis, so if you do a local anesthesia on your unit every day... I think you understand what this could mean in the long run *byebye penis*..
If you're feeling pain it means you're going too fast. Either too many sets or too much weight. Take it slow, build up over time. Being anxious is the number one cause of injury.