Are the laws of the Torah eternal?
The Torah is eternal and - since it's Gcd-given - it knows how to keep up with the times.
For example: While electricity wasn't known about until recently, Torah scholars have figured out from the Torah what the laws of electricity are, say for Shabbat observance. Same for space travel, wireless communication, and all modern inventions.
On the other hand, the Torah does not change its mind to adapt to new norms that society continuously redefines. The laws are the laws and they need to be kept.
That said, Torah scholars will occasionally forbid (or strongly recommend against) certain things that have become socially taboo. For example, marrying multiple wives is allowed by the Torah but strongly discouraged by the Rabbis in the Western world.
The examples you bring all have the same answer, in essence:
Observing Shabbath ---- It is written in Exodus 35:2 that one who does work on Shabbath shall be put to death. Is it followed?
It is still in force, but since we don't have a Bet Din as prescribed by the Torah, there is no way to implement it. Only a Bet Din with specific requirements can execute. Technical problem prevent us from implementing this law.
That said, for a person to be executed by Bet Din, he needs to be warned by 2 kosher witnesses that his action will get him executed, and then immediately respond that he is aware of that fact and that he's going to do the crime anyway and then immediately do the crime.
So it was extremely rare for somebody to be actually executed by Bet Din. (That's besides for the extensive cross-examination that Bet Din was required to do.)
Cursing one's parents --- It is written in Exodus 21:15/17 that one who curses his parents shall be put to death. Will any parent do it?
It was not up to the parents to kill their kids; only a Bet Din could do that - with the same conditions as mentioned above; warning, witnesses, etc.
Adultery - It is written in Leviticus 20:10 that the adulterer and adulteress shall be put to death, so is it done?
Same story as Shabbat - technical problems prevent us from implementing it.
Gay relationship - It is written in Leviticus 20:13 that gays/lesbian shall be put to death. So do we follow it?
Gays who have actual sex with each other: Law is still in force; technical issues prevent it from being implemented, as above.
Lesbians: There is no such a law in Leviticus 20:13 or anywhere else. Though the Rabbis strongly discouraged such behavior.
Excommunication - Do we boycott those that intermarry?
This is not Torah law, it's a Rabbinic advisory to prevent such behavior. Many communities still shun those who intermarry. Others may find it more productive to keep the lines of communication open.
Similarly, any Mitzva requiring a Bet HaMikdash (Temple) cannot be done, since we don't have one. Technical issue; nothing to do with being eternal.
And your last question: Do we cling to the letter of the law or in the spirit of it?
The short answer is the letter of the law. But the written Torah without the Oral Torah (documented in the Mishna, Talmud and other places) is only half the story.
So "an eye for an eye" is not taken literally; the Oral law teaches us that it means monetary repatriations. It's the letter of the law, once you know what the actual law is.