Hi, welcome to Pokemon. To answer your game mechanics question first, stat boosts, like Swords Dance, Dragon Dance, etc, remain in effect only until you switch. So it you have swords danced 3 times with Scizor and you switch(I can't imagine why though...), you will lose all those attack...