It is wonderful to see someone so deeply thoughtful about Teshuvah (repentance) and how to most effectively change oneself and be closer to Hashem. If I understand your question correctly, the tension that you describe is one that lies between actions and character traits (middot). The action in which you are engaging is wrong and thus takes you further from Hashem, but in your sense of distance you feel small and that it therefore lessens the character trait of pride that you feel is a block between you and Hashem. Could it possibly then be that doing something against Hashem’s directions to us could bring a person closer to Hashem?
As a general rule, a study of Talmud and the works of classical Jewish thinkers indicates that the answer is “no”. While there is indeed a concept of errors and sins being transformed into merits (Talmud Yoma 86B), that is something that happens after a person has done teshuvah and ceases to engage in those activities anymore. The person changes himself or herself and no longer does these things, and thus what was once a problem in their relationship with Hashem has now been transformed into something that prompted teshuvah and growth and thus became a good thing in retrospect. But as long as one is still repeating the error, it lacks redeeming value. Thus, the same page in the Talmud also brings a debate as to whether people are even permitted to confess sins that they have already confessed in the past but to which they have returned, comparing it to “a fool repeating his folly” (Mishlei/Proverbs 26:11).
In a similar vein, the Rambam (Maimonides) critiques the notion of choosing to sin even with a plan to repent. In his Laws of Repentance (4:1), he notes that one who makes a plan to sin and figures that he will rely on repenting afterwards will have a very difficult time accomplishing that teshuvah. While it is understood that human beings make mistakes and will at times fall prey to temptations, we are not permitted to choose to go down that path light-heartedly with rationalizations of future spiritual growth.
The issue that you raise of pride getting in the way of your relationship with Hashem is indeed quite an interesting and complex topic. Arrogance is treated as a deeply negative character trait. The Rambam lists it (Laws of Deot 2:3) as something that has no constructive use and that a person should avoid at all times. However, arrogance is not the quite the same thing as pride. Arrogance is dismissive and generally directed outwards towards others, whereas pride can in many cases be an appropriate sense of the value of oneself and one’s accomplishments. Indeed, there was an entire school of Mussar self-development called Slobodka, whose focus was on helping people recognize their own greatness. In seeing and feeling deeply how truly valuable they were, people would naturally rise to the high standard of behavior that fit a person of their level of greatness and character.
It is often assumed, and likely incorrectly, that feeling low and small is an inherently good thing in one’s spiritual development and relationship with Hashem. However, the definition of true humility may be quite different. The Torah (Bamidbar 12:3) describes Moshe as being the most humble of men, but clearly Moshe did not assume himself to be lowly or a “nothing”. Far from it, he took on the role of being the greatest of all prophets and the leader of the Jewish people! A man who thought he was nothing would not have been able to assert himself in the ways that Moshe did.
So it seems that a different definition of humility may be in order here. The Talmud at the very end of Tractate Sotah (49B) quotes Rav Yoseph as correcting those who claimed that there were no longer any truly humble people around, “because I am here.” While it seems like the punch line of a joke to point out to others that “I am humble,” there are those who explain that humility doesn’t mean thinking that you are small and incapable but rather “thinking about others.” That could mean thinking about other people, as well as thinking about Hashem, but thinking as little as possible about oneself. The arrogant person thinks primarily about himself, and the humble man thinks about others (while maintain the awareness that he is a worthwhile human being.)
We do indeed begin again and again, and part of Rebbe Nachman’s teachings is that one should never give up. Even at the lowest moment, we are capable of change and can start moving in a better direction right now. Hashem did not create human beings to be perfect, and expects us to make mistakes. Rather, our job is to aspire to spiritual greatness and to try our best to get there.