If they are hair-like sized and wiggle pretty violently when in the water column, then I would agree with your guess on detritus worms. These will not cause harm to anything and will level out in time. Vacuuming the substrate can rid it of organics which feed these guys.
If however they are flat, elongated oval shaped and crawl on the glass you would have planaria - which are not good for shrimp. There are chemical treatments for planaria that are shrimp safe, 'No Planaria' I recall being a suitable option.
I would highly highly advise against adding any fish to rid worms in a shrimp tank or you will quickly find you have no more shrimp (or at least no baby shrimp) due to predation. Virtually any fish will eat a shrimp or shrimp baby if given the opportunity. Certainly any fish that would eat a work would eat a shrimp, without a doubt.
Those that do keep fish and shrimp together will often find shrimp population growth to be very slow for the reasons above.