haha, you can blame that on subaru for making boxer engines :P
Suggestion; A good percentage of that quote will be labour, engines take quite some time to rebuild, especially boxers. Keep an eye out at your local wreckers, and you could find yourself with a 3-4k job instead. Swapping an engine over could mean 2 hours. Rebuilding could mean 2 days. However if you need the car straight away you dont have a choice.
As cisco said, imports = good option aswell. Japanese have very strict road rules, if your car is older than 10years then you need a special permit for it to still be on the roads + safety updates etc... Therefore large market on import cars and import parts.
The decisions are do 1) top end, 2) import replacement, or 3) top end + bottom end. Roughly $4K, $5K, $6K. 2 and 3 come with 12/20 warranties. 1) they reckon is bad if you wanna hang on to the car - bottom end will slowly go to crap. 2) you can't be sure of what you get. 3) recommended option. Labour is about 18hrs for 1) and 24 hrs for 3). I like the car and it's in good nick so I'm leaning towards 3)