Effect of competing laser transitions on intracavity optical second-harmonic generation