I generally have immediate goals in mind for my NPCs, but I often retcon in motivation and backstory as seems helpful for what is happening in the game, and to keep up the pressure on the players...
...I sometimes find it can be a challenge to keep all the revealed backstory of a recurring NPC in mind (so as to avoid inconsistencies) - I try to use various forms of notes on my main campaign outline to help with that.
I think this is a big danger with Schrodingers-cat NPCs, and I really want to avoid versimilitude-crushing inconsistencies, so I would generally avoid your approach of "have immediate goals in mind for my NPCs, but I often retcon in motivation and backstory as seems helpful for what is happening in the game, and to keep up the pressure on the players..."
I typically do it more like:
1. What is NPC motivation.
2. Based on #1, what are NPC goals.
3. What are PC motivations (refer to backstory) and current goals (refer to events in game and stated intent).
4. How might NPC goals interact with the PCs and their goals to create an interesting scene-frame (not 'scene' - since I only determine the start of the scene, not how it will resolve).
Sometimes I will start with #3 and create NPCs based off PC backstory & motivations, this gives the strong NPC-PC connections that are good for dramatic play. These NPCs intially may be a bit 2-dimensional, with goals but no strongly delimited underlying motivations (eg Vale, the black-hat villain who wanted to hunt down a renegade PC who'd fled her order of evil wizards). But once created the NPCs quickly assume an independent life, acquiring motivations.