Try not to introspect…
A horse can stand and walk on day one, and rapidly develops a set of (usually) 4 natural gaits with trade-offs between speed, energy usage, stability on various surfaces and so on.
Then a horse can be trained to add gaits: pacing, ambling, racking and so on. They get better with practice, and eventually become automatic. There is no reason to believe continuous cortical attention (but this can be tested).
A gait is a sequence of movements, with motor output and sensory input feedback that is highly time constrained. It sounds a lot like HTM, but sub-cortical. So one should be looking for a repeating brain structure (like columns), a data representation (like SDR), perhaps in the cerebellum, with both sensory and motor connections.