How do I check if the player is either walking or standing still?

You should untangle the above logic before you continue. You have sprinkled input gathering throughout your entire controller, top to (almost) bottom. That’s gonna make things very hard to reason about and likely result in a lot of duplicate code, double-checking the same button, bugs, inconsistent behavior, etc.

Instead, try this approach: it makes handling decisions about speed much simpler and more reliably:

For example, I don’t even see you using speed above after setting it.

If you want another great example of breaking input gathering apart from input processing, here’s a basic first person character controller:

That controller has run, walk, jump, slide, crouch… it’s crazy-nutty!!