If you believe they are insect larvae of some sort...and the more often I view those pics, the more firmly I feel that they are not...then a dewormer isn't designed to do anything for you. Dewormers aren't even effective on all types of worms, so thinking that they will help you kill caterpillars (insect larvae) is not realistic. I just realized that "drain" fly might be an autocorrected version of "crane" fly. Crane flies look like mosquitoes, but are huge by comparison, many times bigger than skeeters. Thank goodness they don't bite.

If that's not what you mean, what are "drain" flies?
If you don't want these critters living in your tank, a much better solution than reaching for a bottle of mysterious chemicals would be to simply deprive them of whatever it is that makes your tank attractive to them. In the case of almost all these suggested ID's, that would be excessive food and build-up of sludge and detritus in the tank.