Trainer or air flow meter?

Hi, I drive a 323 BG BJ 89 have a problem with the trainer or air volume meter???? I changed the air filter and accidentally pulled it on the plug above the air filter box. Did nothing go off but was just a bit out. And after installation the engine jumped on, but only for 1 to 2 seconds – then went off. Also no gas on. When I pulled the plug out again and went in again, the engine started and ran, but when I gave gas it went out . Once again the plug in and out and it went so well again. But I think the speed of the course is too low. In any case the plug has something to do with it. There is also something blocking and also sometimes not. Is there a certain technique like I have to plug it in or is the lucky thing? I am grateful for any help! mfg Marcus