For setting the sprite of the player, using this system and another for figuring out what they're doing I've gotten it down to a single line of code:
sprite_index=animations[action,dir_facing/90]
Using an array has the added benefit of being able to change the sprite indexes contained in it at any time, for example if you wanted to change the clothing the player was wearing all you would need is a block of code to update the values in the array that only needs run once as opposed to a mountain of new if statements in the player running almost every frame.
Besides that though, dir_facing is a variable you'd want a lot of the time anyway. Any time the player wants to interact with something in front of him, or use an item normally you'd have to figure out what way they're facing first, but it's so much easier to just have a variable like dir_facing lying around instead.