Never under any circumstances force someone to take money from you.
There is a reason he refuses to accept it (might be a wrong one, like assuming you can't afford it right now even though you can). By forcibly gifting the money you are denying his point of view which will only hurt your friendship.
To solve your own ego issue (that feeling you are in debt with your friend) try to figure out what exactly they value most in your friendship. This obviously isn't anything about money so there must be something else they get out of it.
The first thing that comes to mind is just having some certainty that you will be there for him if something goes wrong. For example, if his house gets flooded in some natural disaster and they need a place to stay for a couple of weeks, they know they can sleep at your house. Or if they would break their leg and need someone to get groceries or make food for a couple of days they might know they can count on you.
We have a friend that because of a handicap can't work and has trouble doing daily chores. This means she never has any cash left over, and whatever she does have she (has to) invests in making her life easier. At some point her coffeemaker broke down at a time where she really couldn't afford to buy a new one. You could see the stress in her eyes for what it would mean for the rest of the month. So we just gifted here a cheap but decent one. The kind of thing that if our own one broke down we wouldn't even think twice about and just get another one like that and get on with our life.
This wasn't really the first time something like this happened so we know she hates being in debt with someone. The previous times it was more about lending her the money that she paid back a month, maybe two months later when she could afford it again. But this thing was given as a gift so we didn't accept any money from her. Instead we sat her down and had a talk about why we felt like we wanted to give her this gift.
What we need most at this time in our life is having someone to talk to. Someone who actually listens and understands the difficulties of dealing with a loss. Someone who is just a phone-call away of getting a hug if you just can't cope anymore. And we have the certainty that she will be there in such a time of need. You can't buy this kind of friendship. So just being there for us means a lot more to us than that small price of the coffee-maker. She then agreed that it's those kind of things that she values in us as well (alongside the physical help on things she is unable to do herself because of her handicap) which mostly solved her feeling indebted to us about that stupid little coffee-maker.
As for your friend, nobody here can tell what he values most in your friendship but himself. So sit down with him, talk about it. Explain why you feel you want to pay him back for those months and then actually listen to his counter-arguments. Most likely for him it's not about something specific he will need help with but just having that security that if he really needs someone's help he knows he can count on you to do what you can in the same way he wants to help you in times of need.