First to address refactoring and compacting your event structure, my advice is to not worry about it at all unless it becomes a problem and you have performance issues! I know how satisfying it can be to go over your code and make everything more compact and efficient, but often the way you first imagined the logic to work out in your head is how you set it up in the first place, and that will be the easiest to understand and read for you later, while extremely compact code might be difficult to decipher later down the road when you have a lot more to think about.
That said, the simplest solution is often the best solution, so sometimes if you find your code getting too complicated, it might be a good idea to step back and see where things could be simplified.
In this case, given that your movement is working properly with each direction and diagonals, I would separate the feet animation code from the keyboard input code. Use a variable to keep track of which direction they are going (1-8) and play the correct animation based on that variable.
You might be able to save some animation frames by using the "Mirror" action too, but that can introduce some new complications as well so I would leave that for after you get it working the way you want first.