The gemara talks about a g'yoret who goes to the mikva for her nidut. The question was whether she was really a g'yoret until now; i.e. if she had all the necessary prerequisites. She is now living as a Jewish woman. If she wasn't properly tovelet until now this t'vilah will be acceptable for gerut also. My question is that if she wasn't really Jewish until now she wasn't really a Nidah according to the Torah yet either. Non Jews don't carry tumah nor transmit tumah. So now if she's going to the mikveh she's going for nidut which doesn't apply to her if she isn't Jewish. She's not going l'shem gerut. How does she become a g' yoret without the proper kavanah?
Tevilah with Kavanah for the sake of "an act which is done by Jews" is sufficient. Therefore, even though she was not yet an actual Giyores, since she had in mind that she was doing an act of being Jewish, it is a valid Tevilah.
Mordecai Kornfeld