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.