How much am I allowed to edit my ESL friend's Master's Thesis?
It sounds like you're doing all the right things regarding helping without actually writing for your friend. I would explain to your friend, and ask them to meet with their adviser, either with or without you, to discuss how much/what type of help is appropriate. With the adviser included in the process, and some boundaries identified, it will be clear that plagiarism is not taking place. That being said, this is a huge time committment on your part. It might help you and your friend for them to work with a writing coach. Your school probably has a writing center or ESL center that can help with this.