Step 7 of the attack is calculate damage. Defeat occurs when a figure has suffered damage equal to its health. Parting shot's trigger is "when you have suffered damage equal to health, but before you are defeated, you may interrupt, blah blah, then you are defeated." The attack resolves after step 7. Conditions are applied after the attack resolves.
If the figure is defeated during the attack, the attack still resolves, and conditions and keywords are still triggered after the attack. There might be some weird fringe situations that need additional rulings, but the normal flow makes sense. Parting shot would trigger before stun gets applied, making stun (or bleed) a pretty useless surge cost if you know the attack will defeat the figure...