A few uhs were taken out, as well as a stammer here or there. For the most part I've formalized spoken informalisms like 'ya' to 'you' and 'oughta' to 'ought to,' though I did leave in a few instances of 'gonna' just because I think it sounds better.
I've bolded and italicized a few words that I think deserve special emphasis and which he emphasizes in his speech, but there are many times he raises his voice and "bolds" words that I have transcribed in regular type; I can't try to convey all his powerful intonations and speaking style via thicker font, you really just have to listen to it.
If you want to listen along as you read (which I highly recommend), the audio is embedded below via both the original Internet Archive source and a youtube video I created using that audio (and one picture from Wikipedia).
Please let me know if you spot any typos or mistakes in my transcription.
But If Not
A Sermon by Rev. Dr. Martin Luther King, Jr.
November 5, 1967
There was a day when many of the Israelites found themselves in bondage in Babylon. There was a king of Babylon by the name of Nebuchadnezzar, you read about him a good deal in the book of Daniel, and it stands as an epic that will remain stenciled on the mental sheets of unfolding generations. Nebuchadnezzar was a mighty king, and when he ruled, he ruled and when he issued an order he meant business. And Nebuchadnezzar issued an order. He made a golden image and his order was that everybody under the reign of his kingship had to bow before that golden image and worship it. Now those of you who read the Bible remember that story. One day Nebuchadnezzar called in the judges and the governors and the sheriffs, and they had a dedicatory service for this golden image, and then he said to them "I'm instructing you to see that everybody bows before this golden image." But there were three young men around there. One's name was Shadrach, the other one's name was Meshach, and the other name was Abednego. And they answered—and I read it from the scripture—and said to the king
"O Nebuchadnezzar, we are not careful to answer thee in this manner [sic].Now I want you to notice first, here, that these young men practiced civil disobedience. Civil disobedience is the refusal to abide by an order of the government or of the state or even of the court that your conscience tells you is unjust. Civil disobedience is based on a commitment to conscience. In other words, one who practice[s] civil disobedience is obedient to what he considers a higher law. And there comes a time when a moral man can't* obey a law which his conscience tells him is unjust. And I tell you this morning, my friends, that history has moved on, and great moments have often come forth because there were those individuals, in every age in [and?] every generation, who were willing to say "I will be obedient to a higher law." These men were saying "I must be disobedient to a king in order to be obedient to the King." And those people who so often criticize those of us who come to those moments when we must practice civil disobedience never remember that even right here in America, in order to get free from the oppression and the colonialism of the British Empire, our nation practiced civil disobedience. For what represented civil disobedience more than the Boston Tea Party. And never forget that everything that Hitler did in Germany was legal! It was legal to do everything that Hitler did to the Jews. It was a law in Germany that Hitler issued himself that it was wrong and illegal to aid and comfort a Jew in Hitler's Germany. But I tell you if I had lived in Hitler's Germany with my attitude, I would have openly broken that law. I would have practiced civil disobedience. And so it is important to see that there are times when a man-made law is out of harmony with the moral law of the universe, there are times when human law is out of harmony with eternal and divine laws. And when that happens, you have an obligation to break it, and I'm happy that in breaking it, I have some good company. I have Shadrach, Meshach, and Abednego. I have Jesus and Socrates. And I have all of the early Christians who refused to bow.
"If it be so, our God whom we serve is able to deliver us from the burning fiery furnace, and he will deliver us out of thine hand, O king.
"But if not, be it known unto thee, O king, that we will not serve thy gods, nor worship the golden image which thou hast set up." 
Now the second interesting point is that these men never doubted God and his power. As they did what they did, they made it very clear that they knew that God had the power to spare them; they said that to the king: "Now we know that the God that we worship is able to deliver us." And that grew out of their experience. They had known God, they had experienced God in nature and they knew God as the creator. And then they had seen God in history. And then they had seen God, I'm sure, in their personal lives. They never doubted God's power to deliver them.
[break in recording?]
But let me move now to the basic point of the message. Know this morning, if we forget everything I've said, I hope you won't forget this. It came to the point after saying "Our God is able to deliver us from the burning fiery furnace, but! if he doesn't deliver us, we still are not gonna bow." "But if not"—do you get that? That these men were saying that "Our faith is so deep and that we've found something so dear and so precious that nothing can turn us away from it. Our God is able to deliver us, but if not..." This simply means, my friends, that the ultimate test of one's faith is his ability to say "But if not." You see there is what you may call an 'if' faith, and there is a 'though' faith. And the permanent faith, the lasting, the powerful faith is the 'though' faith. Now the 'if' faith says, "If all goes well; if life is hopeful, prosperous and happy; if I don't have to go to jail; if I don't have to face the agonies and burdens of life; if I'm not ever called bad names because of taking a stand that I feel that I must take; if none of these things happen, then I'll have faith in God, then I'll be alright." That's the 'if' faith. You know, a lot of people have the 'if' faith. Jacob found himself in that dilemma once, and his faith was contingent on an if. And he said "Now if God will be with me and if he will keep me in this way that I go; and if God will give me bread to eat and raiment to put on, that I come again to my father's house in peace, then shall the LORD be my God."  That's the 'if' faith; Jacob hadn't quite gotten to the essence of religion.
There is a 'though' faith, though. And the 'though' faith says "Though things go wrong; though evil is temporarily triumphant; though sickness comes and the cross looms, neverthless! I'm gonna believe anyway and I'm gonna have faith anyway; though the waters thereof roar and be troubled, though the mountains shake with the swelling thereof, the LORD of hosts is with us; the God of Jacob is our refuge."  And old Job got to that point, he had a 'though' faith. He looked out and everything that he had had been taken away from him, and even his wife said to him "Now, what you ought to do, Brother Job, is to curse God and die. God has been unkind to you, and you should have let God know a long time ago that you would only follow him if he allowed you to stay rich, if he allowed your cattle to stay in place. You ought to curse him and die, Job, because he hasn't treated you right." But Job said "Honey, I'm sorry but my faith is deeper than that. Though he slay me, yet will I trust him. My faith is a 'though' faith." And this is the essence of life and religion. The question is whether you have an 'if' faith, or whether you have a 'though' faith.
You know what this says in substance, that ultimately religion is not a bargaining matter. A lot of people bargain with God. "If you just let me avoid pain, God; if you allow me to be happy in all of its dimensions; if you don't allow any suffering to come; if you don't allow frustrating moments to come, then I'll be alright, I'll give you a tenth of my income , and I'll go to church and I'll have faith in you." But religion is not a bargaining experience, it's not a commercial relationship. And you know, no great experience in the bargaining atmosphere. Think of friendship, think of love, and think of marriage. These things are not based on 'if,' they're based on 'though.' These great experiences are not based on a bargaining relationship, not an 'if' faith, but a 'though' faith.
And I'm coming to my conclusion now. And I want to say to you this morning, my friends, that somewhere along the way you should discover something that's so dear, so precious to you, that is so eternally worthful, that you will never give it up. You ought to discover some principle, you ought to have some great faith that grips you so much that you will never give it up. Somehow you go on and say "I know that the God that I worship is able to deliver me, but if not, I'm going on anyhow, I'm going to stand up for it anyway." What does this mean? It means, in the final analysis, you do right not to avoid hell. If you're doing right merely to keep from going to something that traditional theology has called hell then you aren't* doing right. If you do right merely to go to a condition that theologians have called heaven, you aren't doing right. If you are doing right to avoid pain and to achieve happiness and pleasure then you aren't doing right. Ultimately you must do right because it's right to do right. And you got to say "But if not." You must love ultimately because it's lovely to love. You must be just because it's right to be just. You must be honest because it's right to be honest. This is what this text is saying more than anything else. And finally, you must do it because it has gripped you so much that you are willing to die for it if necessary. And I say to you this morning, that if you have never found something so dear and so precious to you that you will die for it, then you aren't fit to live. You may be 38 years old as I happen to be, and one day some great opportunity stands before you and calls upon you to stand up for some great principle, some great issue, some great cause—and you refuse to do it because you are afraid; you refuse to do it because you want to live longer; you're afraid that you will lose your job, or you're afraid that you will be criticized or that you will lose your popularity or you're afraid that somebody will stab you or shoot at you or bomb your house, and so you refuse to take the stand. Well you may go on and live until you are 90, but you're just as dead at 38 as you would be at 90! And the cessation of breathing in your life is but the belated announcement of an earlier death of the spirit. You died when you refused to stand up for right, you died when you refused to stand up for truth, you died when you refused to stand up for justice. These boys stand before us today, and I thank God for them, for they had found something. The fiery furnace couldn't stop them from believing. They said "Throw us into the fiery furnace." But you know the interesting thing is, the Bible talks about a miracle. Because they had faith enough to say "But if not," God was with them as an eternal companion.
And this is what I want to say finally, that there is a reward if you do right for righteousness' sake. It says that somehow that burning fiery furnace was transformed into an air-conditioned living room. [light laughter] Somebody looked in there and said "We put three in here, but now we see four." Don't ever think you're by yourself. Go on to jail if necessary but you'll never go alone. Take a stand for that which is right, and the world may misunderstand you and criticize you, but you never go alone, for somewhere I read that "One with God is a majority," and God has a way of transforming a minority into a majority. Walk with him this morning and believe in him and do what is right and he'll be with you even until the consummation of the ages. Yes, I've seen the lightning flash, I've heard the thunder roll, I've felt sin's breakers dashing trying to conquer my soul but I heard the voice of Jesus saying still to fight on, he promised never to leave me, never to leave me alone; no, never alone, no, never alone. He promised never to leave me, never to leave me alone. Where you going this morning, my friends, tell the world that you're going with truth. You're going with justice, you're going with goodness, and you will have an eternal companionship. And the world will look at you and they won't understand you, for your fiery furnace will be around you, but you'll go on anyhow. But if not, I will not bow, and God grant that we will never bow before the gods of evil.
Scripture references (at least, the ones I noticed):
 Daniel 3:16-18
King misspeaks in quoting the King James Version in verse 16, saying 'manner' instead of 'matter.' Also, here is the NIV translation, which better explains what it means to not be "careful" to answer:
"O Nebuchadnezzar, we do not need to defend ourselves before you in this matter. If we are thrown into the blazing furnace, the God we serve is able to save us from it, and he will rescue us from your hand, O king. But even if he does not, we want you to know, O king, that we will not serve your gods or worship the image of gold you have set up."
 Genesis 28:20-21
 Psalm 46:3, 7
* In the audio it sounds like there aren't contractions in these places, but context suggests that Dr. King is just not enunciating the ending clearly.
I had two questions that I've been thinking about. First, King says he would have "openly" broken Hitler's law against aiding Jews? Interesting to wonder whether he literally believes that it would have been important to openly break that law and have approximately 0% chance of not being summarily killed, or whether he might be open to breaking that law in such an extreme case in secret so as to be able to help more Jews and do more good. He was a really big fan of non-violently breaking laws and publicly suffering the consequences in order to wake up people's consciences to injustice. What do you think he meant there?
Secondly, I find it interesting that he feels OK calling Jacob's faith into question, saying he "hadn't quite gotten to the essence of religion." We don't usually critique prophets in any way nowadays. What are the upsides and downsides to doing so?