-
For your first point you’d probably want to investigate why your system doesn’t suspend or what exactly is going on. You could check logind.conf, specifically the HandleLidSwitch* keys. Otherwise, your lid switch should have a corresponding /dev/input/ event that you could maybe listen to or something.
-
I can’t offer much input on your second point. I think unplugging the audio jack should probably trigger a udev event that you could write a rule for. No idea about wireplumber though.
I know it sounds dumb, but lying still and thinking the same word over and over seems to help me if nothing else does the trick. If you notice yourself thinking something different just get back to it.