One who says, ‘I will sin, then repent; I will sin, then repent’ is not permitted to repent. (Masechet Yoma 85b)
What happens to somebody who says to himself, "I will sin then repent, sin then repent," then does exactly so numerous times in a wicked way.
However, later on he realizes that this was his biggest mistake in life and - thinking he lost his chance of doing teshuvah - feels true genuine regret, begins to live an honest and upright life, is humble to himself and the people around him/her, changes his wicked ways once and for all, tries to repent with full love for Hashem, tries to do teshuvah in all honesty as effectively as possible with full heart, soul and intention, doesn't want to lose the ability to do teshuvah, feels remorse and never returns to the sin again.
Can Hashem have mercy on that soul?