Quantum discrimination and estimation are pivotal for many quantum technologies, and their performance depends on the optimal choice of probe state and measurement. Here we show that their performance can be further improved by suitably tailoring the pulses that make up the interferometer. Developing an optimal control framework and applying it to the discrimination and estimation of a magnetic field in the presence of noise, we find an increase in the overall achievable state distinguishability. Moreover, the maximum distinguishability can be stabilized for times that are more than an order of magnitude longer than the decoherence time.