The faster Pokemon would switch out first. So, Scarfchomp would switch out first, then your Shuckle. This also applies to the start of the battle. If at the start of the battle I sent out a ScarfTar and my foe sent out Politoed, then my Sand would set up, and Rain over it. (Just a little lesson.) This is the reason I despise ScarfTar.
In Short
Faster Pokemon switch first.
Source: Extensive experience and failure with ScarfTar.