I had a similar problem and it turned out to be the fuse under the hood had cracked (not blown) and was making intermittent contact, turning the AC on and off. I replaced the fuse and the AC now works perfectly.
I hope yours is as easy to fix.
'88 300E 265K
'91 300TE 155K