The way I would do it:
Grab Ledge:
- When Sprite Position reaches near ledge during a jump, stop Jump Event.
- Change Animation to LedgeGrab-Animation.
(Align the frames of animation with their Hotspot so, that they will be perfectly aligned with the ledge/wall.)
For the Pull it depends on how much animation You want to use.
Depending on that I would program it differently to make the movement more smooth.
The easiest way would be to have no extra Pull-Animation.
Instead, to get up the ledge from the grab, You trigger a Jump.
So You would be jumping up the ledge from Your grab.
I think a lot of old 2D games used this method.