The literary device used in the sentence "He did not realize that his last chance was walking out the door" is most closely aligned with:
B. Human traits are applied to an abstraction or nonhuman object.
In this case, "last chance" is personified as if it has the ability to walk out the door, which fits the definition of applying human traits to a nonhuman concept.