change sprite command doesnt let you select a specific frame on the sheet
double page with self switch, then
although, I believe you *can* specify a frame, with some trickery (not by default)
what I meant was, you can use the move route tool as a way of passing commands to another event indirectly.
with that in mind, you can use the move route and *it's* capabilities from the target event's perspective as a way of altering the behavior of that event.
it's tricky, but it gives you some flexibility if you don't want to add a full plugin for that one edit.
Basically, on the guard event, after he moves in front of the door, do the unlocking method you've chosen.
a heads-up for the OP, regarding that: don't consider objects in the scene as physical objects.
what you call "a door", isn't exactly "locked" or "unlocked", nor does it "open" or "close", and it doesn't have hinges nor guides, nor locks.
what you're dealing with is an obstacle that lets (or not) the player through.
*it* being shaped as a door comes *on top* of it being a scene object, and the guard doesn't (and shouldn't) interact with it, because the guard is another obstacle, one that doesn't affect the player's movement, but one that is part of the sequence of actions that ultimately affects that obstacle that lets the player through, so it should be included in the action.
when that happens, you're better off by adding another event that controls both objects, if the interaction is complex.
in this case, either the guard or the door itself can be the controller and the other be the controlled, depending on which one is the focus.