I'm looking at putting a new engine into my Jeep Wrangler right now. A crate HEMI runs ~9k new, and you can't get it installed for less than ~$4k in labor. I'll be able to get a used one for ~$5k
Obviously some cars a cheaper, but I wouldn't want to be swapping engines in a BMW or Merc (competitors for the Model S)
A crate HEMI is in no way a "standard" replacement engine for a Jeep Wrangler. While it is a common swap for the Jeep (for hardcore off-roaders), it's equivalent to a high performance motor, for which you should expect to pay a premium.
Obviously some cars a cheaper, but I wouldn't want to be swapping engines in a BMW or Merc (competitors for the Model S)