If you were talking about something that was rare, or maybe a lot older rebuilding the engine might make sense. Also if you wanted more power it might be worth considering.
But the price for a low mileage used one is about 2000 dollars for a high to a low of 650 dollars I am not sure it is the wisest thing to do.
To rebuild the engine right means that the car will be off the road for at least a week (more like a month). With a used engine, it can be back on the road in one day.
By the way a rebuilt motor (long block) runs about 4000 dollars.
A JDM engine (which might have more horse power) runs about 1500 dollars, some include shipping.
www.car-part.com