Ivermectin is not a viral medication, covid19 is a virus. different type of disease.
Most medications affect various things. Just because something was first used for one condition doesn't mean it isn't also great at another condition. There are lots of drugs used in this way. Even aspirin -- pain reliever, anti-inflammatory, fever reducer, and anti clotting are all different things.
the vaccine was based on prior research of the American flu. that research has been around for 10 years.
mRNA vaccines require not just the idea of using mRNA as a vaccine, and not even just getting it into mice in whatever way (from about 1990) -- but getting it into human in vivo cells (a) in 1 or 2 injections, (b) in enough quantity to have therapeutic effect, and (c) without unacceptable immune response.
Parts (a) through (c) are what have taken from 1989 to about now to solve. Many pharma companies gave up on mRNA therapeutics. Moderna was founded in 2010, and it took them until about now to have the first one that can be used in humans. Even then, it was done under emergency use authorization.
mRNA vaccines today are like a supersonic plane in 1947. Yes, powered aircraft had been around for more than 10 years, but not ones that had what was needed to go supersonic, which took a lot of new development and new ideas beyond what was around in 1937.