Well the code should still works, the thing is the character would most likely jump every time the oponent is on the air or landing, players could exploit this behavior, knowing the ai would jump everytime, it's like a weakness in my opinion
Anyway, does the code work?