In order for a person to be killed by the Death Note there are only 3 relevant requirements:
- They have to be alive...obviously...
- You have to write their true name.
- You have to picture the person as you write it.
Every person has a true name which can be seen with Shinigami eyes. That name does not change. There are several details we don't know about how that works but a nickname will never appear there.
You have two questions:
- Are repeated writings of an alias considered by the Death Note to be intentional misspellings, unintentional misspellings, or just invalid input?
- What happens if I accidentally write the correct name thinking it is an alias?
If you write the correct name (spelled correctly) while picturing that living person, that person will die. You do not need to know what you are doing as you do it. So in the case of you last question, the answer is: "Yes, the victim will die."
We don't, however, have enough information to answer the first question. When Light was writing the name of the victim from the first episode he kills in the street, he writes at least 8 different spellings of his name. He knows only one of those could be correct. As the name is among the first 4 (third I think), the victim dies. Light does not die for writing the final 4 nor does the victim retroactively become immune. This is the only time we see so many misspellings of a person's name. The last 4 either seems to be considered invalid input (as he is already about to die) or misspellings that don't make him immune as he is already doomed.
We can speculate that if the person thinks he knows a person's real name, he cannot be intentionally misspelling the name to make that person immortal. Therefore, the owner will likely not die from this course of events. This, however, is just speculation with a limited amount of evidence.
What we do not know at all is whether the Death Note will consider the correctly spelled alias to be a misspelling of a person's given name at all. A correctly spelled alias is technically not a misspelling so might not count. If the name is very different, it is possible it might not be recognized as belonging to that person so that person is not impacted at all. This is the key point to the question and at no point in the anime or in the part of manga I've read has there been anything to clarify this further. I personally would go as far as to say the Shinigami probably don't know the specific answer to this question.