The MAF sensor monitors the amount of air flowing in to the engine. When the MAF sensor is unplugged, the ECM needs to rely on other sensors to determine approximately how much air is entering the engine. If you have a vacuum leak and the MAF sensor is working, the car will misfire because the ECM uses the MAF sensor to calculate how much fuel to add. But, due to the vacuum leak, there is additional air in the engine so the air - fuel ratio is off.
So, if you have access to a vacuum gauge I'd suggest you check the manifold vacuum when the engine is running poorly. Since it seems to act up more when the engine is warm, it's possible the leak is something related to temperature like a manifold gasket or EGR system.
You could also check fuel pressure since the fuel pump will heat up when running for several minutes, especially if the tank is near 1/4 full or less.
-Rod