It might be another number for movement_code. It's complex but it's in there. And there is no easy way to do it. Axys code is not user friendly. You just need to set up a movement state, a normal moving mode and a ledge grabbing movement mode, what one is selected is based on a variable like 'movement_mode'.
And if you don't have the experience with coding implementing something like this is kinda tricky. You have to do several trace instructions to get it to work correctly in every position without giving you bugs. I would do those traces, keep tracing in front of the players head until you hit something, once you hit something you then need to do a few more traces to make sure there is a ledge above you. Use the original hit point of your original trace, trace say 150 quants above it down to the same z position, but a little more forward from where it hit, if that trace returns a good sized number you know it's a ledge.
I then, in the same frame, place the player at that position and do a gravity trace with use_box to make sure the player isn't stuck in anything, I then return the player to it's original position and change the movement mode accordingly.
It's easy to set up something basic, it's hard to get something to work without bugs and works consistently in all situations. It's even harder to sync an animation with ledge grabbing. Once animations are involved and you need to sync it with the movement, it gets tougher...