You cannot "swap" compositions. To create a sprite-sheet/ strip you have to have all elements in a pre-composition and use time-remapping or something like that. I'm just not sure why you would want to use convoluted expressions, especially since AE is not interactive and you still have to keyframe stuff. I mean figuring out the walk direction is not that difficult, but how would you determine in which direction he is looking? You still need some parameter for that. It's not like you would push a button on a gamepad. That being the case, you might just as well keyframe everything from the start. In fact then you'd don't even need any time-remapping and just cut your looping clips together while they are e.g. parented to a Null that you move around.
Yep, would have been good to find a solve. I'm faking a game board with an avatar with different animated cycles based on which way it is moving along a path. I can (and am) keyframing visibility of differnt comp cycles using transparency. Not hard, but woudl be nice for client iterations to just have her animation swap as we redesign and redesign the animation path.