My 1991 240DL volvo has
When you unplug the mass airflow sensor, the car goes into "limp home" mode in which it runs full rich. Generally speaking, if a car runs better with the mass airflow sensor unplugged than with it plugged in, the mass airflow sensor has failed.
However, the drifting idle tends to make me want to look for vacuum leaks and check the rear temperature sensor on the driver side of the head. I suspect that running over-rich is compensating for the vacuum leak so the car keeps running.
If you have a propane torch or a can of diesel starting ether, spray it around the intake manifold while the car is idling and see if the engine speeds up. If so, then you have found a vacuum leak.
If it were mine, I would buy a new intake manifold gasket and replace it as a routine maintenance item. It is not expensive or difficult to replace except that if you are like me, you WILL drop at least one nut, and there are several great hiding places on that side of the engine where the nuts go to hide when you drop them. You will need a magnet to recover them. You don't need to pull the manifold clear off, you just have to pull it clear of the bolts so you can slip in a new gasket. You can leave the throttle cables and most of the other connections hooked up
If you know how to use an ohm meter, you might consider getting a manual for this car and looking up the appropriate resistance/temperature values and checking that rear temperature sensor.
While you are replacing that intake manifold gasket, check all the vacuum ports to make sure they are clear, and check all the vacuum hoses to make sure they are intact. Also check the tubes between the mass airflow sensor and the throttle body for cracks. While you have those air tubes off, clean the throttle body and the idle air control valve with some carb cleaner. Spray a little carb cleaner through the mass airflow sensor as well. Actually, there is a special spray for cleaning mass airflow sensors that is more gentle, but I have used carb cleaner on them many times with no apparent ill effects.
If it turns out that the mass airflow sensor has failed, that will run some $$, but having a fresh intake manifold gasket and clean throttle body and no vacuum leaks will be worth your time and money and make the car run better when you are done.