Doping-Modulated Semiconductor-to-Metal Transformation in a Low-Band-Gap Two-Dimensional Material