An optimal control problem for a system of nonlinear parabolic equations modeling the migration/proliferation dichotomy of glioma cells is investigated. The solvability of the optimal control problem is proven, and necessary first-order optimality conditions are obtained. A justification for the weak bang-bang principle for optimal control is presented. A numerical algorithm based on the finite element method has been developed and implemented. Numerical experiments demonstrate the effect of additional oxygen supply on vascular density and the switching of tumor cell phenotype from invasive to proliferative.