I second the changing of the filter.
I have had a very similar issue with losing 4th gear on my W123 a few months ago:
Lost 4th gear.....
Symptoms were pretty much the same: Sometimes 4th would work, and when it didn't I could coax it into 4th gear, but I couldn't keep momentum going though. It would slip like crazy.
The transmission fluid itself looked fine; I am pretty sure the PO had changed it not too long before I bought the car. I thought for sure my transmission was toast, but based on the advise here (thanks guys!) decided to just change fluid and filter and pour in a bottle of Trans-X, just for the hell of it.
I didn't think it would help much, as my tranny fluid looked fine...However, after dropping the pan I realized the filter looked in rough shape. 
Changed the fluid and the filter (drained torque converter as well), threw in a bottle of Trans-X, and it's all OK again. Pretty sure that it was the restricted filter not allowing enough pressure to build up to engage 4th gear.
It would really suck to change the fluid again if you 
just did it, but if you didn't change the filter than it's worth a try. Don't forget to change the pan gasket as well.