|Return of the Jedi by Tyler Stout
Scenes like that almost never happen in RPGs because players are drilled to never, ever, under any circumstance, split the party. If the DM does pry them apart, he faces the prospect of half the table rolling dice and having fun while the other half spectates. Eventually the spectators will get their turn, but that just means the table flips and someone else watches the party through the window.
Some GMs can handle this situation with flair, but most would rather not try. It's a road fraught with peril. Here's an alternative worth considering.
Instead of splitting the party, create a second party of NPC allies to complement the first. At some point, the allies must be sent off to capture and open the castle gate while the heroes seek out and neutralize the enemy necromancer. Just as the characters are about to confront the villain, hand out new character sheets for the NPCs assaulting the gate. The players take over those NPCs until they've cut their way into the guardhouse, then the action jumps back to the palace, where the necromancer's undead servants are swarming to the attack. The necromancer slips through a secret door as characters hack their way through the last flaming skeleton, then bam! They're back in the guardhouse, fighting a desperate battle up the winding stairs to the winch that lifts the portcullis. Just as they seize the control room, kapow! The necromancer is casting his last, most potent summonings to save his life ...
And so on, back and forth, until both scenes hit a climax.
Besides the obvious advantage that everyone is always in the action, players also get a chance to step out of their usual roles and be a different type of hero for a while. Better yet, because they have nothing invested in the NPCs, players can take insane risks in the name of heroism.
"It's a suicide mission, but someone needs to delay a dozen ogres at this gate!"
"I'll do it, Captain. No need for thanks; you can buy me a drink when we meet in Hell!"
Players get the emotional involvement of a story that they're invested in with treasured characters plus the wild abandon of a one-shot game with disposable heroes. It can even be structured so the NPCs must sacrifice themselves to achieve victory, though that path isn't for everyone.
One set of characters can't be everywhere at once, but the players can be, at least for a while, with a bit of planning by the DM.