The cheapest solution is a salvage yard engine. This is also the quickest solution.
The funnest thing to do would be to swap in a Japanese Domestic Market Engine (JDM). You might be surprised at the added horse power.
The most expensive is an engine rebuild. This can prove to be the best. But what you will find out is that the engine replacement may cost more then the car is worth.
Now if it were my Miata, I would replace it (already have one waiting to drop in).
But if this is just a set of wheels to you, think about a new car.
car-part.com