Well, I don't know what your background is, I mean mechanic, welder, engineer or what.
The 4GR-FSE your looking at with 9k miles on it? 4k for the motor, and you'll need the trannyand ECU.
The issue isn't about how much space you have in the engine compartment. this issue is where the motor mounts are located in relationship to the drivetrain lining up. For example, if the motor you looking at putting into the car is smaller than the stock motor, but in order to line up the tranny to the motor you have to raise the motor mounts and narrow them, the top of the motor could still stick right thru the hood. Your going to have to do alot measureing and research before you can just shove any motor in your car.
I will say that anything is possible though. If you have the expertise at welding and understand the dynamic torque that is exerted on the welds and metals, and you have the mechanical experience to change over all the neccassary issues, then you can put a chevy 350 small block in there if you want. But then it raises the question, if you do in fact have all that, then why not buy an engine block already made to fit, and then build your own motor the way you want it ( Better fuel mileage, or more hp) and then put it in. Dollars to sense should come out ahead.