The metal-insulator phase transition, quasiparticle damping and superconductivity in a layered Fermi gas