The shepherd does not say much in the play, but he is a pivotal figure. The reason for this is that King Laius, after hearing the prophecy of what Oedipus would do, commanded him to expose the child. However, he did not comply, because he felt compassion for the baby. So, he gave the child to another shepherd, who in turn gave it to another. Eventually the baby ended up in the house of Polybus, King of Corinth.
In this way, the shepherd did not do as he was commanded, which was punishable by death. More importantly, the shepherd knew what all of this meant. He, Oedipus, Laius, Polybus, or anyone else could not escape fate. As the Greeks well knew: "Not even the gods can fight fate." The prophecy of Oedipus would be fulfilled. This is why the shepherd reluctantly spoke these lines:
If you are the man he says you are, believe me you were born for pain. (1304-1305; Fagles)
The shepherd knew that everything would come to light. This would mean trouble for Oedipus and him. Therefore, he would rather have a heavy mouth. Who would want to utter what Oedipus was fated to do and has already done?