The biggest concern with medications and shrimp is the amounts of copper that might be present in the medication. To much copper and you will kill your shrimp and make almost any invert either very sick or dead. Even most snail eradication formulas have a high copper base to kill the pest snails.
The best I can suggest is read the list of active ingredients very closely, if they don't list actual % rates of a particular chemical the rule of thumb is the closer to the beginning of the list the higher its concentration.
Then you could either remove as many shrimp as possible prior to treating the tank and keep the shrimp out for the duration of treatment and then use charcoal and other chemical removal products to remove residual chemical before putting the shrimp back in the tank.
Or you could also try leaving the shrimp in the tank and use the medication at half dose like you would for loaches, fry or tetras.