He's as trapped by your chaotic whim as you are by his retribution. At times, he feels like an antagonist, but really he's narrative design personified. There are a few reasons it works so well, the most obvious of which is the narrator's character. Some of these 'endings' are lighthearted, some are absurd, some are unnerving, most are self-referential, and many centre around the narrator's attempts to get back to his story.
Each combination of choices leads to something unique. At each of the game's many intersections, you can follow the narrator's instruction or ignore it and face the consequences of your petty resistance. Whatever you choose, TPS branches, and branches, and branches again. You're you, with all the free will and sense of rebellion that implies. There are two doors, and you're not Stanley. When he says that Stanley heads through the left door, you. When he says that Stanley walks through the empty corridors, you walk through the empty corridors. When he says that Stanley leaves his office, you leave the office. Through Stanley's first-person perspective, you follow the narrator's instructions.