Here is my response.
First, let’s define “sin” as: missing God’s moral and spiritual target.
Next, let’s define “prayer” as: talking with God about what we (God and I) are doing together.
God will always hear you when you pray. God hears everything and knows everything. If right now you are talking with God a thousand miles away from where I am, I do not hear you. But surely God does.
God will never refuse to help you when you pray. Remember that God is love, and God’s mercy triumphs over judgment.
It is true that sin makes a separation in relationship. God never collaborates with sin. This is good. But this does not mean God will not help us. God is in the business of helping us get extricated from the tangled and twisted web of sin. If it were true that God doesn’t help us when we are trapped in darkness then none of us would have been rescued, since we were citizens of the kingdom of darkness. God loves us always, no matter our spiritual condition. (This does not mean God loves our spiritual condition, no matter what shape it’s in.) God is a Lover, a Reconciler, and a Redeemer. God doesn’t turn his back on lost sheep, he goes after them.
God will always help you, no matter how screwed up you are. But God’s help will not always be what you want. God is a redemptive God, always looking to make lemonade out of the lemons we have made. If we have sin in our life God will hear us and help us, showing us the way out of our weakness.
I think it’s dangerous to tell someone that God will not help people who have sin in their lives. If that were true then we could never come to God and confess our sins and receive his forgiveness. This could quench a person’s prayer life by getting them to think that God has turned his back on them until they get their act together.
Remember that “grace” is getting something we don’t deserve.
Remember also that praying is all about collaborating with God about his Kingdom Mission. Ultimately, prayer is about asking for help in advancing God’s Kingdom. God will never refuse that, and in the process will address anything sinful in us that needs to be straightened out.