I believe, once the direction is set, find the player (which would be $game_player, but this can also be used for events), and use the following code:
As I see, you can change the pattern from 1-4 or something like that. By the look of this snippet in Game_Character 2:
@pattern = (@pattern + 1) % 4
It should be based on the 4x4 character set layout. Not sure if this works, but it's the only possible solution I could find.
To check if it is in a certain pattern, just use the same code without the operation of course. Pretty obvious.
Hope this works out for ya.