Are you sure they're not just detritus worms?I would treat the shrimp and the tank for planaria. That's what I think they are. There is a med out there--I think it's Genchem brand--specifically for killing them called 'No Planaria.' Panaria are nasty, they get right inside the poor shrimp and kill them. Is it allowed to post links here? Well, Amazon offers 'No Planaria' for around $15. I'm sure you can find it.
@mistergreen, if you're still around, I'd like to ask why you said you thought they were not planaria? Did you see something we missed? I'd like to know what you based your opinion on. I'm not arguing, mind you, I'm just always interested in learning.