Luke, that is a good question. One not on John 9 - that is not Jesus speaking, it is the man that was healed. Therefore we should not treat those words as necessarily reflecting exactly correct theology. God always forgives our sins when we come to Him - He is faithful and just to do so.
I John 1:9 - If we confess our sins, he is faithful and just and will forgive us our sins and purify us from all unrighteousness.
But are there conditions? I would say that there are two in Scripture:
1 - A humble heart
2 - Treat other people as you would want to be treated - treat others with justice and righteousness
God Hears the Humble
Ahab was one of the most wicked rulers Israel had - and yet when he humbled himself before God his prayer was heard.
James 4:6 - God opposes the proud but shows favor to the humble
Psalms 138:6 - Though the LORD is exalted, he looks kindly on the lowly; though lofty, he sees them from afar.
I Kings 21:25-29 - (There was never anyone like Ahab, who sold himself to do evil in the eyes of the Lord, urged on by Jezebel his wife. He behaved in the vilest manner by going after idols, like the Amorites the Lord drove out before Israel.)
When Ahab heard these words, he tore his clothes, put on sackcloth and fasted. He lay in sackcloth and went around meekly.
Then the word of the Lord came to Elijah the Tishbite: “Have you noticed how Ahab has humbled himself before me? Because he has humbled himself, I will not bring this disaster in his day, but I will bring it on his house in the days of his son.
Right Relationship with Others
All throughout the Bible we see that God responds to those who treat others with compassion and justice. I highly suggest reading all of Isaiah 58 - God was not listening to the Israelites and despised their sacrifices because they were mistreating others. However, God told them that true fasting is to care for those in need. Powerful!
Matthew 5:23-24 - Therefore, if you are offering your gift at the altar and there remember that your brother or sister has something against you, 24 leave your gift there in front of the altar. First go and be reconciled to them; then come and offer your gift.
I Peter 3:7 - Husbands, in the same way be considerate as you live with your wives, and treat them with respect as the weaker partner and as heirs with you of the gracious gift of life, so that nothing will hinder your prayers.
Isaiah 58:6-10 - “Is not this the kind of fasting I have chosen:
to loose the chains of injustice
and untie the cords of the yoke,
to set the oppressed free
and break every yoke?
is it not to share your food with the hungry
and to provide the poor wanderer with shelter—
when you see the naked, to clothe them,
and not to turn away from your own flesh and blood?
Then your light will break forth like the dawn,
and your healing will quickly appear;
then your righteousness will go before you,
and the glory of the Lord will be your rear guard.
Then you will call, and the Lord will answer;
you will cry for help, and he will say: Here am I.
“If you do away with the yoke of oppression,
with the pointing finger and malicious talk,
and if you spend yourselves in behalf of the hungry
and satisfy the needs of the oppressed,
then your light will rise in the darkness,
and your night will become like the noonday.