Where does one draw the line for which forms of life are ok to destroy, and which ones are not?
That (i.e. "which forms of life?") might be not the right question.
If you're describing the situation based on a premise of violence versus non-violence, then another way to look at it might be aggression versus non-aggression, and/or aggression versus self-defence.
For example Buddhists are typically forbidden to tell lies, but there's the following Q&A from "Good Question Good Answer" by Bhante Dhammika. In the chapter about the five precepts, one of the question is whether you should lie to a killer to prevent them from killing. His answer was that,
"If you were sitting in a park and a terrified man ran past you and then a few minutes later another man carrying a knife ran up to you and asked you if you had seen which way the first man had gone, would you tell him the truth or would you lie to him?"
"If I had good reason to suspect that the second man was going to do serious harm to the first I would, as an intelligent caring Buddhist, have no hesitation in lying. We said before that one of the factors determining whether a deed is good or bad is intention. The intention to save a life is many times more positive than telling a lie is negative in circumstances such as these. If lying, drinking, or even stealing meant that I saved a life I should do it. I can always make amends for breaking these, but I can never bring a life back once it is gone. However, as I said before, please do not take this as a license to break the Precepts whenever it is convenient. The Precepts should be practiced with great care and only infringed in extreme cases."
I could try to argue that the difference between the killing-the-mouse and killing-the-tapeworm scenarios isn't the "form of life" but rather the difference between aggression (against the mouse) and self-defence (against the tape-worm).
Killing the mouse is a form of aggression ("I hate you, I kill you").
Killing the tape-worm (or, more specifically, medicating your own body for its malady) is arguably a form of self-defence rather than aggression -- maybe it's that which makes the difference.
You might argue that mouse-in-house is self-defence too, however IMO that (attacking-within-house) is straying ever further from defence-of-self: perhaps you ought to be thinking, of your house, "This is not mine, this is not me, this is not my self." and therefore not trying to defend it as if it were yourself.
The fact that the mouse is in a "house" implies you're a house-holder or layperson and therefore have many social responsibilities. What if it wasn't a tapeworm in you but in your parent, child, friend, etc.?
I don't want to say that it's clever to kill even tape-worms but maybe non-aggression (don't kill mice) versus self-defence (take medicine) is a way to distinguish the two scenarios.
Another consideration is, if you kill a mouse today then what will you do tomorrow? Instead you might prefer to make your house mouse-proof, or perhaps store your food and clothing in mouse-proof containers.
Similarly, if you eliminate a tapeworm today then what will you do tomorrow? I looked in the introduction to the Vinaya to see whether I could see there any instructions about parasites: and didn't find them. A "purge" is a permitted type of medicine for what that's worth. There are however several instructions in the Vinaya: about keeping yourself clean, and about eating cooked food.