Ionization entropy and charge-state-controlled metastable defects in semiconductors