You are such a good person to have gone to see him! I'm sure he knew you were there and felt your forgiveness. I know you gave him peace before he passed.
God bless you and your children for offering kindness and compassion to him before he passed.
I wouldn't blame yourself for not answering his texts. I firmly believe that actions have consequences. His behavior and treatment of you resulted in you not wanting to connect with him or believe his messages. I don't think that is on you, but really on him.
You could not have changed the outcome of his illness and you offered him love and peace in his final moments. I don't think you could have done any more than that.