There are two paradigms I see people use to solve this:
1. Text back as soon as you see the message and be okay with your response not being optimal. This is what I do the most.
2. Don't open the app to read the message until you have time to respond, then commit to responding. This way you'll have the message notification reminding you to respond and you don't leave your friend on read.