If the attacker is touching me when I shock them, will I get shocked as well?

No. If the attacker is touching you, you will not be shocked. The shock provided by the stun gun will not conduct from one person to another. The effects of the shock are localized only to where the contact is made.