Let's say we need another 10,000 hammers to finish the ship. With power and labs, we need 4000 raw hammers. With the space elevator added, the need is 3,333 raw hammers.
Space elevator = win, worth almost 100 raw hammers, maybe even 300 if the fusion engineer helps!
Does it cost 10000 Hammers for two Engine parts? It has been my experience that building the Engine part (in Vanilla or Warlords) or both Engine parts (in BtS) will be your gating-factor on your launch date (equal to your Victory date in Vanilla and Walords). However, this situation means that we only need to worry about the cost of the parts which act as our gating-factor for our Victory date, not every single Spaceship part.
I just checked my latest game and each Engine part costs 1600 Hammers each (Emperor level, Normal Speed).
Now, feasibly, the Docking Bay could be the last part that you build, if you delay researching Genetics, which costs 1200 Hammers, but I find that Health is so important in BtS late-game that I will generally not research Genetics as the last Spaceship tech and therefore I tend to build the Docking Bay earlier at a time when it does not act as a gating-factor for our Victory date.
Similarly, the Life Support component part, from Ecology, could be the last part that gets researched, but with its cheap cost (1000 Hammers) and bonus from Copper, it's usually a part that you can build to completion in an auxilliary Hammer City while another City is still completing an Engine part.
So, at least for me, the Engine parts are the gating-factor for the date of when I'll be ready to launch my Spaceship. Preferably, I will have two Cities that are building the two Engine parts, meaning that the ONLY Build Item which matters for a Hammers savings will be the last of the two Engine parts to complete.
Outside of a One City Challenge game, it is POSSIBLE that you may get the most efficiency out of building BOTH Engine parts in the same City, so we can say that for a non-One-City-Challenge game, building BOTH Engine parts will be the extent of our gating-factor. Your calculations should therefore use the cost of the two Engine parts and not the entire Spaceship to see whether having the Space Elevator can speed up the completion date of your Spaceship.
Now, if you could find a way to fully leverage an empire's saved Hammers from the Space Elevator, then you'd have more of an argument for using a figure like 10000 Hammers. However, the reality is that even when building Wealth or Research, the Hammer gain will be relatively neglible enough not to give you any additional savings on your research, or at very most, 1 turn saved. So, you're talking about getting the Computers tech and the Robotics tech in 1 or 0 turns... but you're also talking about using Espionage. If you're going to get sufficient Espionage Points, it probably means that you spent Commerce on Espionage. In that case, you didn't spend the saved Hammers on speeding up your research (because the additional Gold or Research wasn't used alongside 100% of your Commerce going to Science but was only used alongside a portion of your Commerce going to Science, with some of it also going to Espionage), meaning that you probably lost out (or at best made no gain) in terms of research using the "Hammers saved" being spent on Wealth or Research.
But okay, you want to imagine that we magically had sufficient Espionage to steal Robotics and for some reason also had Computers (say, we got it in trade)--perhaps you accidentally spawned a Great Spy and used it for some additional Espionage Points--but then you have to weigh the opportunity cost of not getting a better late-game Great Person or not using this Great Spy as part of a final Golden Age--so, sure, we'll say that you didn't have perfect management of your Great People and had an "extra" Great Spy that couldn't be used in a Golden Age.
Even if you make all of these assumptions, though, the potential savings from the Space Elevator need to be weighed against the final Spaceship part (or parts, if you are building a couple of the final parts one-after-another in the same City), not against the cost of all Spaceship parts.
Now, if we have no coal OR aluminum
I am even more lost when you bring up this point. The Space Elevator gets a bonus from Aluminum, while the Engine Parts and the potentially-late-built Docking Bay do NOT gain any Resource bonus.
So, if you talk about missing out on said Resources, particularly Aluminum, then building the Space Elevator becomes even worse of an idea than it already is.
If you do not have Coal at all, then chances are that you won't be spending any Hammers on Coal Plants. Since you need to research both Fission and Plastics in order to complete the Spaceship, it is not unreasonable to assume that, at least in your key Spaceship-part-building Cities you will build Hydro Plants, Nuclear Plants, or will have access to Power via the Three Gorges Dam.
So, a lack of Coal will only potentially hurt your Ironworks City, in that you won't get Coal's +50% bonus to production. In fact, since you don't have access to Coal, you might as well build the National Park (if it is yet unbuilt) in your Ironworks City. Normally, doing so is a BAD idea, since the National Park disables Coal in a City and thus NEGATES the effect of Coal's bonus to Ironworks... but if you don't have Coal anyway, you might as well get some extra Health in the Ironworks City for a potential couple of extra population points--say, for another Engineer Specialist or two. But that idea is a side-issue... the real truth is that you'll have a Forge, a Factory, Power, a Lab, and Iron in that City, already giving you a +200% bonus to production, so the loss of the Coal's further +50% (for a total of +250%) isn't really that big--which is also the same argument for the Space Elevator's additional +50% Hammer bonus not having much of an impact.
Meanwhile, even if you were to magically get the Computers tech (you have the choice between Refrigeration and Computers but Computers costs considerably more Flasks than Refrigeration so I tend to skip Computers), the Robotics tech, and 2 Great Engineers at no additional cost to your empire (the 2 Great Engineers are to rush-build the Space Elevator, so that missing out on Aluminum wouldn't matter in terms of building the Space Elevator), then guess what? The final parts that matter (the 2 Engines and the Docking Bay) do not even have associated Resource bonuses!!! Therefore, the presense or absense of a Spaceship-part-Resource like Aluminum is not going to speed up or slow down the building of your final, Victory-date-gating Spaceship parts. The absense of Coal will only marginally affect the Ironworks City, with the ultimate best case for the Space Elevator being that the Ironworks City has:
Forge = + 25%
Factory = + 25%
Power (you WILL have Power here or else you're playing to lose) = + 50%
Laboratory = + 50%
Iron (if you don't have Coal OR Iron then you wouldn't have built Ironworks in the first place, so since we are assuming that you don't have Coal, we HAVE to assume that you have Iron in your Ironworks City) = + 50%
That gives us a total of + 200% bonus Hammers, which equals 300% of our base Hammers.
Gaining the Space Elevator would give us an extra + 50% bonus, for a total of + 250% bonus Hammers, which equals 350% of our base Hammers.
I admit that I suck with Percentage-based math, but I think that how it works is that you would devide 350 by 300 (please correct me if I am wrong).
350 / 300 = 1.167
So, you're talking about a 16.7% savings.
But, what we are REALLY talking about is the RELATIVE savings of having or not having Coal.
With Coal, we'd actually have + 250% bonus Hammers in our Ironworks City without the Space Elevator, for 350% of our base Hammers.
With Coal plus the Space Elevator, we'd have + 300% bonus Hammers in our Ironworks City, for + 400% of our base Hammers.
Again, assuming that I am doing the math correclty, we're looking at:
400 / 350 = 1.143
So, in that case, the Space Elevator gives a 14.3% savings.
If we take the without-Coal savings and subtract the with-Coal savings, we get:
16.7% - 14.3% = 2.4%
So, that's the additional contribution of the Space Elevator in a Resourceless situation: 2.4% savings on the cost of the last Spaceship part (or on the last couple of Spaceship parts if you build said parts in the same City). Thus, the question that you need to ask yourself is: "Will those additional Hammers be sufficient to speed up your Victory date by 1 turn?"
If not, then there really isn't a case for building the Spaceship Elevator simply because you are lacking Spaceship-part-related Resources like Aluminum and Copper or a Power-and-Ironworks-related Resource like Coal.
Ok, it's almost always absolutely godawful.
Without the qualifier "almost" in there, or with "almost" representing a fractionally small percentage, then I think that you've hit the head of the nail (instead of hitting your thumb) with your Hammers.
As for Shrines... while you may poo-poo them, chances are that you will do your best to build Wallstreet and found your Corporations in a Shrined City. So, you can generally expect to have one of them in a late-game type of Victory condition, such as a Space race, thus whether or not they are amazing doesn't really matter--you'll tend to have one anyway.
But, if you want to do the math, the problem is that a Shrine, like a Great Merchant Mission, is very situational. A widely-spread Religion offers more value, but the same can be said if you manage to have a peaceful, far-flung AI that managed to build a large-sized City with The Temple of Artemis and a Harbour in it... the lack of either can tip the scales in favour of one versus the other. The good part about the Trade Route Missions is that, assuming that you aren't at war with everyone, you can fund many of them, but Shrining a second Religion is almost certainly not going to be as good as Shrining the first Religion, assuming that you were able to build a Shrine for the Religion (for which you own the Holy City) that was the most wide-spread of all of your Holy Cities the first time that you Shrined a Religion.