From: Rabbi Moshe Sofer
To: Rabbi Chaim
A Sefer Torah contained an erroneously inserted Divine Name in the third commandment. The Chasam Sofer rules that four words including the superfluous Name may be bored out (kediras hashem), the excised piece buried in genizah, and a patch applied over the hole with the legitimate words rewritten on it using elongated letters to avoid creating a false parshah division. He reconciles the apparent conflict between Masechta Sofrim and the Teshuvos HaRosh by distinguishing cases where the superfluous Name itself causes invalidity from cases where it does not.
Source: Shu"t Chasam Sofer YD §272