WHEN CAN ONE FIX A MISTAKE IN TEFILIN? [Tefilin: parchment: fixing mistakes]
Gemara
Rava: I saw a young donkey standing near my head, and braying.
Bar Hedya: The words "Peter Chamor" are missing from your Tefilin.
Version #1 (our text) Rava: I saw them. They are there!
Bar Hedya: In any case, a "Vav" was [mistakenly written and] erased.
Version #2 (Bach): Rava checked and found that a "Vav" was erased.
Menachos 30b (Beraisa - R. Yehudah): If Hash-m's name was omitted, he should be Gorer (scrape off) the word written in its place, write Hash-m's name over it, and be Toleh the erased word (write it in between this line and the line above);
R. Yitzchak says, one may even be Mochek (erase) the word written in its place, write Hash-m's name over it, and Toleh the erased word.
Rishonim
Rambam (Hilchos Tefilin 1:16): In a Mezuzah or Tefilin we do not suspend (write between the lines) even one letter. If one forgot even one letter, he puts what he wrote in Genizah, and writes another.
Poskim
Shulchan Aruch (OC 32:23): If one found that even one letter is missing, they cannot be fixed, for if he would correct them, they would be written out of order. This is Pasul, for it says "v'Hayu" - they must be like they are (in the Torah, i.e. in order). If there was an extra letter, one can fix them through scraping it off, if it is at the beginning or end of a word. If it is in the middle of a word he cannot, for after he scrapes it, it will look like two words.
Beis Yosef (DH u'Mah she'Chasav v'Im): Orchos Chayim brings from R. Yonah that if the scribe omitted a letter or did not make the form of the letter properly, he cannot scrape to fix it, unless he scrapes all that was written from the mistake [and onwards]. If he scrapes all that was written from the mistake and below, this is fine, as long as he does not scrape a name of Hash-m that may not be erased.
Beis Yosef (DH v'Zeh): Sefer ha'Terumah explains that in the Beraisa in Menachos, Greirah is scraping off dry ink, and Mochek is rubbing off ink while it is still wet. The Yerushalmi permits Teliyah in Seforim, but not in Mezuzos or Tefilin. It does not distinguish between Hash-m's name and other words. If is, one may not fix any letter in Mezuzos or Tefilin, nor write on what was erased or scraped off, for above (Hilchos Sefer Torah 199) it is not clear which is better. L'Halachah, we follow the Rambam, who had no Safek, and we are not concerned for the Safek of Sefer ha'Terumah.
Beis Yosef (DH v'Chasav ha'Ri, citing Ri Askandri): One may not erase while it is still wet, rather, only after it dried well near a fire. Then it erases well and does not leave any mark afterwards when he writes over it. Some erasures disqualify, e.g. if a word was supposed to be Chaser (deficient), and it was written full. If the scribe will scrape away the extra letter, the word will be divided into two, and it is Pasul. Do not ask from the Vov in Chamor that was missing from Rava's Tefilin. The Gemara connotes that the Tefilin were Kosher, for it is considered an evil interpretation. If the Tefilin were Kosher, Bar Hedya helped Rava. He prevented him from wearing Pasul Tefilin! There, after the scribe wrote it full, he realized his mistake, erased the extra letter and wrote the Reish over the erasure.
Beis Yosef (ibid.): However, if this occurred after the Tefilin left the scribe, sometimes they can be fixed, and sometimes not. In the first Parshah, Chamor, Se'or and Zove'ach should be Chaser. If they are written full and not fixed immediately, they cannot be fixed later, for the word will be divided. If he will erase the leg of the Reish or the back of the Veis (after the erased Vov), and stick (extend) them to the place of the erasure, they are Pesulim, because erasing the leg of the Reish or the back of the Veis ruins their form. When he writes it afterwards, this is writing out of order. The same applies to Me'odecha, l'Totafos and Mezuzas in the first Parshah, and Nosen, ha'Tovah and Osam in the second Parshah and similar words. They cannot be fixed. However, when one can erase the extra letter and extend the adjacent letter without ruining its form, surely this is permitted. E.g. if the correction was Taluy (right after) a Beis, Chaf, Dalet of Reish, surely one may extend them a little, for one can do so without erasing from those letters, and the form does not change. Therefore, one may fix words like la'Avosecha and ha'Avodah that were written full. I am unsure whether it helps to extend only the bottom of a Tzadi, e.g. in Mitzvos. Even though after extending it, the bottom comes right near the next letter (after the erased Vov), perhaps since above there is space, it is like two words. The same applies to Nosen, and to Hotzi'acha, if it was written with a Yud. Surely, if it looks like two words it is Pasul.
Taz (21): The same Safek applies to a bent Nun (a regular Nun, i.e. not a final Nun), if the bottom was extended more than is proper to fill the line.
Note: I cannot explain why initially, Ri Askandri was sure that "Nosen" cannot be fixed, and at the end he was unsure.
Taz (20): If one must scrape to fix a letter, it is Pasul, for this is Chak Tochos (carving out the inside of the letter. One must write Yerechos, i.e. the outside walls of the letter, i.e. the legs, roof, base...) One must scrape the entire leg written improperly. Even though he fixes it later, this is out of order. However, regarding a Yud, which does not touch the letters themselves, one can fix through sticking (making it touch. I.e. the forms of the letters Aleph, Pei, Tzadi, and Shin all contain one or more 'Yud's -- sometimes upside down - that must touch the rest of the letter). This is not considered out of order. If a Ches was written like two Zayins, it does not have the total form of a Ches, therefore it does not help to fix them afterwards. Based on this, if also the roof (of the Ches, which connects the Zayins) was written, just it does not connect properly to them, surely one can fix this afterwards. The Mechaber says 'some say that...' There is no argument, just it is a new law. See what I wrote about fixing 'Yud's in 36:1 (that it is not considered out of order as long as a minor could recognize which letter it is even before it was fixed).
Gra (DH Aval): It says in Maseches Sofrim (2:1) that if letters were joined or there was a gap in the middle of the name (i.e. word - Nachalas Yakov), one may not read in the Sefer.
Mishnah Berurah (110): If one wrote an extra word, he can scrape it off and leave the area blank (if there are not letters from the previous word that he can extend into that place). A blank space does not disqualify as long as it is not the Shi'ur we leave between Parshiyos, which is enough to write nine letters. Sometimes even this can be fixed, if he can extend a letter from the previous word to diminish the space of nine letters. In a case that the space would disqualify the Tefilin, then even if the previous word ends with Hei or Kuf, one can extend the roof of that letter to diminish the space. Even though through this, the leg of the Hei or Kuf will not be at the end of the letter, b'Di'eved we are not concerned for this. The Pri Megadim says that if a word was (incorrectly) written twice, it is better to erase the latter, for the first was written properly. If the word before the first of the repeated words ends with a letter that can be extended (but the repeated word does not end with such a letter - PF), it is better to erase the first word (and extend the letter before it, so that there is a space of less than three letters), in order to fulfill R. Tam's opinion, that the Shi'ur of a Parshah is three letters.
Mishnah Berurah (112): If the letter before the extra letter cannot be elongated, one can fix it only if he can thicken the letters before and after it [to diminish the space in between, so it will not look like two words] without changing the form of these letters. If from the beginning one extended the bottom leg of a Tzadi or Nun, and the next letter extends into it (i.e. above the leg), e.g. Pnei or Artzi, it is Kosher, since it is in one word. L'Chatchilah one should not do so, for some are stringent about this.