Hiya
There are several things you could try here, so I've included a few from suggestions in what you're currently doing to some different approaches - hope there aren't too many!!
You are right, in an ideal world, you wouldn't want to get stuck in a loop of 'walk forward 2 steps, get treat, reverse, repeat' so you could ask him to step forward onto the ramp and then, when he makes that extra bit of effort (which could be as small as even thinking about moving btw, which sometimes makes more of a difference than waiting for the foot to lift) feed him forwards so he has to think forward whilst he takes his treat. Also how you are you asking? are you beside him? infront of him? Make sure you aren't blocking him in any way.
If he reverses off, walk him forward to the point you left off and make sure he does walk forward more than the previous time so that you change the loop. If he does walk forward a bit further each time, then it doesn't matter that he is walking off the ramp after the click. Ask yourself if he is genuinely going a bit further each time as it sounds that he is offering the same each time and still getting rewarded, hence the pattern he is in. If he isn't offering that tiny bit more, then he doesn't get the click and treat and you may need to be v quick to notice that tiny shift forward when he twigs that he has to put more effort in. You could even put tiny markers on the ramp and focus on asking him to stand on these, rather than going up the ramp as the goal.
Having just been on an Alex K clinic, I'll bring in some ideas from this

We worked a lot on matwork - have you worked on this at all? It can be very powerful indeed to encourage other behaviours. If you were to train Zeffy to stand on the mat and reward things such as standing square, standing without mugging and so on, you build a really strong draw to the mat - in other words, its a great place to be. You can then incorporate the mat not only to create a desire to go and stand on it but also as a reward - you good boy, you walked forward, now you get to stand on your mat. You can then move his mat near the trailer and gradually up the ramp.
To build the matwork, you'd ask him to walk forward to your mat and initially reward just a toe, then a bit more, then one foot, then two and so on. Once he is standing on the mat, you can 'layer up' the rewards (ie making the mat a great place) by asking him to stand square first infront, then behind etc, back him off and reward him for backing politely, reward him for duration on the mat and so on. The funny thing is that often you then have to work on leading them OFF the matt and controlling their walk forward to it as they are so keen to get to it.
This is great and quite normal as it gets you to work on really fine leading skills that will transfer directly to your loading dilemma - focus on leading toward the mat and ask for really tiny steps forward and back. Can you ask him to think about lifting a leg forward? c/t how about backward? c/t You want to be able to ask for tiny weight shifts forward and back - say a couple of steps and then let him walk to his mat as a reward. This will really help you moving up the ramp.
The other option to you is to use targeting (although one could argue matwork is also targeting) - this is what I had to do with my mare, as she would walk into the trailer and then reverse out at great speed which was not safe! I used targeting to help her - does Zeffy target? If so, I'd suggest that you try asking him to target up the ramp bit by bit, either to your fist or to a cone or something (which is what I did). This absolutely gives them the freedom to respond or not and may get you over the hump of going back to where you started each time. Do you have a set up where you can work at liberty? Sometimes freeshaping a behaviour can make huge changes.
One of the things Alex always says is that its worth training a behaviour several different ways to get it really strong, so by combining matwork, leading practice and targeting you hopefully will get over this little bump! If you have any of her books, there's detail on targeting and matwork in there.
All the best!!!