The vise jaws will act as a heat sink and keep the heat from traveling too far. There is also a compound called Heat Fence that will do the same job. You glob it on like peanut butter and it protects the area not wanted to be hot. Heating only the tang willl not ruin the hardness of the blade unless you go too far. Watch out which direction the torch flame is going and avoid pointing down the long axis of the blade.

Really the tang of the razor does not have to be hardened. It may not be hard if it bent in the first place, and a little hammer work will correct it anyhow.