THE FMOS-COSMOS SURVEY of STAR-FORMING GALAXIES at z ∼ 1.6. IV. EXCITATION STATE and CHEMICAL ENRICHMENT of the INTERSTELLAR MEDIUM