The worms/protozoa are killed by the appropriate medication, however if the enclosure is not totally cleaned and sterilized within three days of treatment the frog can be re infected. As you pointed out if the frog is fed food items that are carrying parasites the frog can be re infected, so it would have to be retreated.

I think what you have read is really in the regards to parasite management and not the curing of. If a frog is kept in ideal conditions, parasite loads can be managed and not become a problem. However, most keepers do not maintain ideal conditions, so parasites can then overwhelm a frog, potentially killing it. So that is why I recommend treating for parasites, then three days late sterilizing the cage. It is also a good idea to have the frog rechecked periodically.

In a case of a frog throwing up, along with a localized edema, the frog must see a vet. No two ways around it.