Star Formation and Metal Production as a Function of Redshift: The Role of the Multiphase ISM