A person owes me some money and keeps postponing the repayment always. I made intention to give a sadaqa of atleast $x this year. If he never pays me back, or if I ask him to forget about it or if somehow the debt was never paid back to me due to reasons unknown can that money be counted towards the sadaqa that I intended.
If you relieve him from the liability and intend this as a sadaqa, then yes this will be counted as a sadaqa. However, if you want the money but he does not pay you for some unknown reason, then this will not be counted as sadaqa, because you did not intend it to be sadaqa, and in this case he will be a sinner for not paying his debt.
The logic behind my answer is the Holy Quran. Allah (SWT) says:
And if someone is in hardship, then [let there be] postponement until [a time of] ease. But if you give [from your right as] charity, then it is better for you, if you only knew.