I am the the absolute LAST one to put anything down, from a betta to a horse. Where there is life, there is hope. I've seen too many astounding recoveries (again, from bettas to horses...) to think that a life should be ended before it's time until that life is torment. When a fish is obviously in distress and/or in pain...then the kindest treatment may be to put them down. BUT, until those times, I say life is precious and should be treated as such.
That being said, I know that you only want to do what is best for your boy because you love him, and you want to ease any suffering he might have. I applaud you for this, as it takes strength and a huge amount of love to go through that. But, I don't believe your boy is in pain. I really think he's just lethargic, which could be the winding down of his life, or it could be a response to his head injury. When animals are in pain they pant or otherwise breathe hard, they move frenetically (spazzy, jerky movements), the curl up on themselves (or in the case of a betta, clamp their fins down to their bodies), they chew their bodies (fins, legs, tails, etc.)...You will know if your boy is in pain.
Worse case scenario, from what you've posted, is that he dies quietly in his sleep, or that he dies quietly from lack of nutrition. It's not as if he doesn't have the option to eat, and is in pain because he is hungry. He is not eating because he is lethergic, or because food does not interest him. In this case, if he does not start eating at some point, he will simply spend more and more time sleeping until he does pass away. This is not a terrible way to die, and is probably more pleasant than just about any way that I can think of to euthanise a betta.
If you continue with his care, doing what you can and accepting that whatever will be, will be, he has a chance. He may get better, he may have a wonderful life ahead of him after this rough patch. Or he may pass away, but he won't be in pain or in misery while he does so. He'll simply sleep more and more as his body naturally winds down.
I'm sorry for this long-winded post, and others may completely disagree with me...And I want to say again that I understand where you are coming from, you want to help him, it hurts to watch him so pitiful, and everything you are doing and are considering doing is done out of love and care for your little man. You are a great person, and he is lucky to have had you as his owner and as the steward of his life. :)
Prayers for you and your boy, and I very much hope that he recovers...and if not, then he'll be safe and happy forevermore. :) He has known great love from you, and that is a wonderful eulogy for any animal.