Effects of dopant and impurity incorporation on metastable light-induced defect formation