Optimizing the production of metastable calcium atoms in a magneto-optical trap