An opponent gaining control of it is part of the replacement effect and happens immediately, even if you are in the middle of resolving the spell or ability and it has more instructions to perform after taking damage.

Artwork
Loading artwork…
Khârn the Betrayer
Warhammer 40,000 Commander · #79★ · EN
Nonfoil—Foil—
Card rules
Berzerker — Khârn the Betrayer attacks or blocks each combat if able.
Sigil of Corruption — When you lose control of Khârn the Betrayer, draw two cards.
The Betrayer — If damage would be dealt to Khârn the Betrayer, prevent that damage and an opponent of your choice gains control of it.
5/1
Rare · Illustrated by Kekai Kotaki
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
In some cases, a single spell or ability will deal damage to this creature multiple times during its resolution. In that case, a new player gains control of it each time, its ability triggers once each time, and the appropriate players control those triggers. After that spell or ability is done resolving, all of those triggers are put onto the stack in turn order, starting with the active player (or the next player in turn order if the active player isn't involved). Usually, this means that the cards are drawn in a different order than the control-changing effects took place.
In contrast, the Sigil of Corruption ability is a triggered ability, and it won't go onto the stack until after the spell or ability that tried to deal damage finishes resolving.
You lose control of Khârn the Betrayer when it leaves the battlefield or another player gains control of it.