Once the intestinal worms have been removed from the fish, there is often a lot of scarring/ damage to the fish’s intestine from where the worms were attached, (the worms bite through the intestinal wall to feed on blood). If the fish is in a weak condition (from being infected with worms) then they can sometimes develop bacterial infections in their intestine where the worms damaged the intestine. It isn’t that common but does happen. To prevent the intestines developing bacterial infections after a severe worm infestation, you treat them with an anti-bacterial medicated/ food for about 5 days. This allows the intestine to heal up without the presence of bacteria that could easily infect the damaged area.
Most fish don’t have a problem and if the tank is clean and well maintained, then you don’t normally have to give the fish medicated food to prevent internal bacterial infections. But if the fish are old and weak, then it might be an idea to feed them medicated food after they have been dewormed. However, you should give the medicated anti-bacterial food straight after you finish the worm medication. Because you have been treating the fish for a few weeks, it probably won’t make any difference now. This is because most of the worms will have been expelled from the fish a while ago and the intestine will have healed up to some degree since then. Once the worm damage in the intestine has healed up, there will be little chance for the bacteria to get in and damage the intestinal wall.
It only takes a day or two for the worm damage to the intestine to heal up once the worms are gone. However, the scarring can take months to heal up properly and the intestine can take months to work properly again.
You want to treat all new fish at least twice, preferably 3 or 4 times at weekly intervals. If you only treat the new fish once for 3 days, then you will probably kill off any adult worms inside them. However, any worm eggs in the fish will hatch out after treatment and the fish will need a second or third treatment to get rid of these new worms. The worm eggs take about 7 days to hatch at 26C. Some species of worm take longer, and cooler water will also increase the worm egg hatching time. If the fish are kept in warm water (say 28C) then the worm eggs hatch sooner and you can usually treat the fish 2-3 times, rather than 3-4 times, at weekly intervals.
I would treat the new guppies 3-4 times and keep them away from the other fish until they have finished treatment.
4 adult guppies will be fine in a 2.5g tank for the next month as long as you do regular water changes to keep the tank clean. You might have to do a water change each day or every couple of days to accomplish this. But the fish should be fine as long as the water is kept clean.