Would a random passenger be allowed to fix a problem with a commercial aircraft?
I happen to have personal knowledge of this particular case. I was in that airplane, too, seated two rows away from him. I'm also a former pilot and was naturally very interested in what happened, so I asked him some questions during the flight back.

He had worked as service mechanic for this company before, servicing their planes in Iceland. Their technical staff and the pilot of this plane already knew him, which made things easier.   

Tools and parts were available at the airport in Alicante, but no qualified technician certified for this type of aircraft. The technical staff of the airline contacted his boss in Iceland by phone, who agreed to sub-contract him to the airline for the duration of the repair and pay him overtime for the work.
They faxed a copy of his certification documents to Stockholm to cover the EASA regulations that require a certified professional doing the repair.