Apple - Headphones Jack not pluggable into Macbook-pro retina socket
When you insert the headphone into the socket, it makes connections internally against a number of poles which connect to the different rings on the jack end (left audio, right, mic, ground, data etc..). These are essentially tiny spring loaded contacts which the jack must push aside when inserting, that then rely on sprung pressure to maintain a permanent connection to the ring on the jack. Here are a couple of pictures, a diagram, and a photo or a replacement part that shows one of the poles:
These poles can jam, get stuck, fail etc etc. Usually a vigorous insertion is enough to free them, but this is relying on the chamfered edge of the jack to transfer vertical motion into a horizontal movement of the pole. You could use something slimmer than your jack, and insert (carefully, ensuring you don't insert it too far) before applying sideways pressure directly to the poles to try to get more energy into making them move.
I did this the old fashioned way -- took my 3.5mm connector and hammered it in, using a literal hammer. After doing so, some white dust came out of the port (which I vacuumed up). I'm presuming something was stuck in there? Either way, everything is working now, so +1 for the brute force solution here (at least for me).
Ok what seems to me is you have to separate issues.
The reason for the headphone jack not going in completely maybe due to a jammed pole. the possible solution for which is either trying to forcefully push it in, or take it to Apple care.
The reason for the red light being show is cause the mac is assuming that there is a Optical Digital Out connected, which will be fixed automatically once you insert the jack properly. This I know as I had faced the same issue of the Red light flashing and I had consulted and Apple Tech support and he answered this to me.