Hi, I believe your problem isn't in your coding but in the C2 version you're using.
You see, I'm also making a MMX Game with C2 and my wall jump events are almost the same as yours and it works nicely (You can see it in action here: /watch?v=N1-W7iA3YRc&t=34s no direct link since this is my first post :c).
However when I tried opening your .capx it warned me that it used a more recent version of C2, and well... I found out this tiny little detail in the latest update (r246)
This is what's causing X to wall jump so erratically.
Personally I chose to remain on r245 thinking that little change might break wall jumping and now you proved my fears true. So I guess your options are to either downgrade to r245 or place a condition to compensate for the additional ceiling check.