There are no clinical studies on the effectiveness of caffeine against helminths (if there are, I would be genuinely interested). Albenzadole is widely studied and has a very long track record as a safe and effective drug for treating some helminths (not flatworms, though). I have not had flatworms so I have no experience treating them.
Caffeine, like most herbs, does not come with warnings. And before we can know the effective dose (if any), there needs to be a peer-reviewed study. I have seen people act very strange after large doses of caffeine, and I would feel safer taking Albendazole again.