You are right about the spares.Chief problem with Gripen is the number. Unless current operators give Ukraine their air forces, the number which could be given would be very small. I agree it's a better fit for Ukraine's conditions, but there are probably significantly more spare F-16s quickly available & potentially far more.
As mentioned in another thread, the number of available F-16 MLUs in Europe is actually not very high, some a/c are too old and worn out, others have been sold already. And some countries will not part with their F-16 (e.g., Greece, Turkey). Nevertheless, there are still a few left, and the US may also provide some F-16s.
Saab has 14 new airframes that nobody (so far) has bought, it would take a few months to turn them into aircraft, not sure how much they could speed it up. Sweden have around 100 Gripen C/D several of which will gradually be replaced by Gripen E. Had Sweden been in NATO one could argue that for a limited time period Sweden don't really need 100 Gripen, NATO offers more than enough protection (Hungary and Chechia have 14 Gripen each, and the Baltics have no fighter jets, relying exclusively on NATO allies to provide the capability). One could also argue that even without a NATO membership Sweden could manage with a reduced number of fighter jets for, say, a 2-year period. Some estimates say it will take at least 2 years for Russia to rebuild the military capabilities in the region (others say it will take even longer). I don't know how many Gripen E will be produced during the next 2 years, however the production lines in both Sweden and Brazil are up and running, with several airframes already produced already.
Although not an ideal solution, I think Ukraine could benefit from getting both F-16 and also a few (14 or so) Gripen. The Gripen could then be used mainly for a2a, given their advantages with Meteor, etc. It would complicate logistics of course however I think the Ukranians would be able to handle it, if they are given sufficient training and support.