There is a very important halacha in the laws of writing tefillin and mezuzot: The letters must be written in order in which they appear in the Torah. This principle is known as "kesidran," i.e., in their order. These laws appear in Shulhan Arukh, Orah Haim 32.
Therefore, if a sofer (Scribe) makes a mistake and forgets to write a letter, he cannot go back to that place, fill in the letter, and then return to where he left off. Rather, he must erase all the letters after the omitted letter, and then write the letter he omitted, and continue to rewrite all of the letters he erased. This solution, however, does not work when he already wrote the Shem Hashem, the name of God, since it is prohibited to return and erase God’s name. This stringency does not apply to a Sefer Torah, where even if a sofer omitted a letter, he may return to that place and write the letter. Regarding tefillin and mezuzot, however, since the verse (Devarim 6:6) says, "and these words shall be" (vehayu hadevarim haeleh), interpreted by the gemara (Menahot 34b) as teaching that the parshiot must be written "kesidran," as they appear in the Torah.
What happens if a sofer adds a letter? For example, what if a sofer writes the word ‘zoveah’, which has three letters: zayin, bet and het, and he adds a yud (zayin, bet, yud and het). In this case, the sofer merely needs to erase the letter. In addition, so that the letter should not look like two words, he can lengthen the letter bet, from the top and the bottom. In this case, this is not considered to be a violation of "kesidran" and the tefillin and mezuzot are valid.
Regarding this issue, the buyer has no way to determine whether the sofer writes the letters properly, and therefore, it is crucial to purchase tefillin and mezuzot from a trustworthy, God fearing sofer.