The rules of putting Tagin (crowns) on the letters of a Sefer Torah can be summed up with three mnemonic devices, which are Rosheh Tevot (acronyms).
The first teaches the seven letters that require the three Tagin adorning their top. Those letters are known by the acronym of "ShATNeZ GeS"-the Shin, Ayin, Tet, Nun, Zayin, Gimmel and Sadi.
Second, there is a custom to add Tagin to an additional six letters represented by the acronym: "BeDeK HaYaH"-Bet, Dalet, Kuf and Het, Yud, Heh. However, these letters only receive one crown, not three. Also, the crown is not placed at the left edge of the letter; rather it is more towards the center of the letter. Otherwise, the extra line on top may distort the letter to appear like a different letter. For example, if the Bet would receive a Tag at the far left, it may appear to be a Lamed.
The acronym "MeLECheT SoFeR" teaches that the letter Mem, Lamed, Alef, Chaf, Tav and Samech, Vav Peh, Resh do not get any Tagin whatsoever.
The Halacha of the Tagin is a double edged sword. On one hand, Maran rules that if one omitted them altogether the Sefer is not Pasul. However, if they were inserted, but done wrong, it can invalidate the Sefer. For example, if the Tag was not connected to the letter, it is tantamount to an irrelevant illustration in the middle of the Sefer Torah which is invalid. Thus, it’s better not to do them, than to do them wrong.
There is a question which arises regarding the Tagin in Tefilin and Mezuzot which must be written "KiSidran"-in the order of the Torah, as opposed to the Sefer Torah which can be written in any order (i.e. Sefer Shemot can be written before Bereshit and then sewn together). Is it permissible to complete the writing of the letters of the Mezuza and Tefilin and then go back and add the Tagin? Does this constitute a violation of the Halacha of "KiSidran"? The Poskim write that it is permitted to do so, since the letters are already there and the writing is already kosher.
SUMMARY
It is permissible to go back and add the Tagin after the writing of the Tefilin and Mezuza has already been completed.