First, ties go to the defender, so you need to beat them with 8 dice.
You are correct their Willpower + Counter spelling test will subtract from the net hits (which are added to damage)
You are correct that at low optimization Knockout is arguably better than Stunbolt. Let us try at a larger DP:
Spellcasting 6
Specialization in combat: 2
Mentor with +2 to Combat
Rating 4 Power Focus
Magic 5
Now that is 19 dice of spellcasting (or ~ 6 hits). Instead of rolling Unarmed/Dodge/Melee + Reaction, you roll Willpower + Counterspelling to avoid being tagged. If you are not a mage or an Arcane Arrestor, and you have 5 willpower that’s only 2 hits (or +4 net hits).
Throw this on a force 7 Stunbolt and that’s 11DV which hits more often than Knockout (because mundane will have unarmed + reaction > willpower), and mages will add coutnerspelling but (like yourself) most people have unarmed or dodge just to avoid melee attacks.
The difference in drain is 2 points, (1/2 Force -3 vs. -1) for an increase in hitting (I have 19 dice to hit, you have 8, I am resisted by Willpower + Counterspelling, you are by melee).
Then we optimize the drain resist some…
We want willpower 5 for the extra stun box, and we are a logic mage, so we want logic 5 (softcapping both). We now look into ware, and get some cerebral boosters 3 (.6 essence), potentially some Genetic Optimization: Logic (.2), Daredrenaline (.1) (for willpower tests like drain resist), and round it out with a SURGE for Metagentic Improvement: Logic. You can alphaware the cerebral boosters for more essence space and get more ware. Buy up your Optimized logic to the new soft cap in character creation.
We went from 10 drain resist (5 + 5) to 15 drain resist before initiating for centering and a centering foci. At 15 dice of drain resist, there is an average of 5 hits. We have lost a point of essence and magic, reducing the spellcasting check to 18. 5 hits is a force 13 stunbolt with 0 drain. The new character with 4 magic can only cast up to force 10, but force 10 with 4 net hits (see above) is 14 DV. That will still flatten most people, even losing the two dice from their resistance test.
Say they have 5 willpower and 4 counterspelling (because they are a mage). That’s only 3 hits, or 13 DV. Still flattens them.
If you are a logic mage suffering from drain, you should think about increasing logic.
I think Stunbolt has it’s own clear advantages at higher levels of optimization? I do play on TR 6 (all NPCs have +6 dice on opposed tests), so I live in a world where melee attacks need 15+ dice to connect. I may be biased.