How many miles are on this engine?
Did the mechanic do any other diagnostic checks? Not sure what kind of mechanic would diagnose that you need a new engine based solely on noise. Probably one who was trying to see if you were worth spending time with, or was too busy to bother. I would suggest getting a second opinion. You may be surprised to find your existing motor can be fixed.
What are your goals for the car? What is the condition of the rest of the car? Rust (especially structural rust) can be a killer. You need to make sure the car is worth putting money into. Then be honest about what your budget is.
If the car truly "needs an engine" you have options. Find a good used motor and drop it in if you are just looking for the car to be drivable. If you want to build some power, then you will likely want to look into rebuilding what you have, or maybe buy a crate motor.