Hello and welcome to JustAnswer!
Your problems are coming from a cooling fan that is inoperative. When you are stopped the cooling fan has to come on to pull air through the a/c condensor to keep high side pressure down and cool the condensor. If the fan doesn't operate then high side pressure will become very high. This puts a large load on the engine and will cause the idle to be intermittently drug down.
When this happens and the high side pressure becomes high enough it will vent refrigerant out of the high pressure relief on the compressor.
What you will need to do is check for power and ground at the fan at the time it should be running. If there is power and ground but the fan won't run then it will need to be replaced. Cooling fan failures aren't uncommon on these.