Imagine a highly hypothetical and unlikely situation like this :
>Military
>In charge of a regiment of troops
>Ordered to rig explosives in an area, told the area is clear of civilian presence
>Find out it isn't
>Go against your directive and get the civilians out of the area
>Arrested / court marshaled (I don't know military lingo)
>Going to be executed
>Executioner knows you did the "right" thing, feels killing you would be murder
>You offer to take your own life, rather than leave someone else with the guilt of murder on their conscience
>Kill yourself
I'm pretty sure this is a movie that I can't remember the name of.
But in the above situation, you are -guranteed- to be killed, and you took your own life not out of fear, but out of selflessness to spare someone the guilt of killing you.
I personally don't think God would punish you for something you did to save someone else.