I see it this way: The first one: "[while] Standing at the gate, James was stung by a scorpion . Standing- is used as a particple phrase. " James was stung by a scorpion [while] standing at the gate ".
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.