How can i make a character wall jump?

In my game, Whitebored, I want to make the character do a wall jump when he makes collision with the wall jump blocks(the green blocks with a diamond shaped hole).

This is the code I am currently using, but it is porving to be ineffective.
Does anyone know how i could improve it?