Are you going to break down the tank regardless? If so just put your shrimp in a bucket with some tank water until the tank is ready for them to go back in. If you're on the fence about breaking it down the first thing you need to do is find out what kind of worms they are. There is a sticky at the top of this forum, go in there and there is a thread on how to identify bugs. For what it's worth, even breaking the tank down and redoing it, you're probably going to have this problem again as fauna just happens in shrimp only tanks when there are no fish to eat them. So instead of panicking off the bat, go educate yourself on all the creepy crawlies so you can be more informed of when is the time to panic
Nematodes, detritus worms, rhabdaceola are harmless. Nematodes and detritus worms actually help clean debris. So yes, find out what you have first. Again, if you just want to break the tank down go for it, but if you're only wanting to break it down because you see worms I think you need to slow down first and figure out what they are. I know I wouldn't break down a tank because of it.