If someone was holding many hostages and I came along and offered to trade myself for the hostages place so they can be let free, would this be right to do or wrong to do and would be detrimental to my practice if I am killed?
It is a highly meritorious deed that could potentially give you heavenly births. But that doesn't mean you have to do it. Using all your money to free the cattle from slaughter houses and starving in the process is also a great deed. But that doesn't mean you have to do it. Offering your life to cultivate goodness is only a requirement of Bodhisattas who aim for Buddhahood. It is called Paramatta Parami. Unless you are aiming for Buddhahood, you don't have to do such things.
While it's certainly a noble deed, just remember the Dhamma emphasizes both compassion and wisdom. They are like the 2 wings of a bird and are both equally important. A good Buddhist should also be a good and skillful problem solver. So before resorting to sacrficing oneself, one should be smart and use his intelligence to come up with novel creative solutions that maximize the benefits to both others and oneself first. Self-sacrifice is most noble because not everyone can do it, but it should be a last resort if one decides to do it AFTER all other options have been exhausted.
I don't what situation you're considering, but spare a thought for your long-suffering parents?
One of the problems with suicide is the grief it causes to those who are left alive.
I think an axiom of ethics is, that an ethical action is an action which doesn't cause regret or remorse (and, is "praised by the wise").
Depending on the situation, you might at least consider whether an action is, an action which your parents would approve of.
Even if you wanted to become a Buddhist monk, for example, I think the Vinaya requires you to get your parents' permission first, doesn't it? There are ways of doing that, in time, it's not impossible, it is a consideration though.
If you offer yourself up as a sacrificial lamb thinking that it is a noble or heroic act, you are merely casting yourself into delusion. If you choose to preserve your life because you think doing otherwise would be detrimental to your practice, you are also casting yourself into delusion. This situation — violent men holding hostages — is completely dominated by competing delusions and attachments. It's unwise to view it as a question with a simple, monolithic answer.
The only real question you should ask yourself, as a buddhist, is whether you can guide the people involved — the criminals, the hostages, the police, the bystanders... — out of the collective delusion they have become trapped in, without becoming trapped in it yourself. This is an intensely karmic context, like walking into a hurricane, and unless you have the grounding in being to drain off that maddening energy you'll just get swept up by it, and do no good for anyone.
It would be detrimental to one's practice if one sacrificed there life out of some belief that it was noble rather than sacrificing thier life because that's the appropriate thing to do for all involved including oneself. One would be less likely to be reborn in the right conditions for practice.
The ideal, the Buddha may or may not find it appropriate to sacrifice themselves(I don't know) but a Buddha wouldn't trade their free mind for it to be taken hostage again. I mean the Buddha wouldn't or couldn't sacrifice Buddhahood, the Buddha would do whatever was appropriate.