In light of electric vehicles (EVs) and demand-side management, a combined optimization paradigm for microgrid (MG) resource scheduling is proposed in this study. Renewable energy sources, including wind and solar power, fulfill a fraction of the consumption demand, while the MG maintains a connection to the electrical network to facilitate power transactions. By utilizing EVs, we can mitigate the inherent volatility of renewable energy production with manageable loads and level out the system's demand profile. The proposed system employs a bi-level programming strategy, wherein the initial level is dedicated to the minimization of aggregate costs, encompassing those related to energy and reserves. Additionally, costs associated with resource redistribution due to the uncertainty of solar and wind power output are minimized at the second level. Subsequently, the objective function is addressed using the enhanced adapted approach of modified marine predators algorithm (MMPA), chosen for its robustness and effectiveness as an optimization technique. The outcomes obtained for a microgrid underscore the superior performance of the results achieved through the application of the MMPA algorithm when contrasted with alternative established methodologies. The outcomes have demonstrated that integrating EVs and adaptable loads contributes to a decrease in operational expenses and emissions. Furthermore, the uncertainties associated with WT and PV are effectively counterbalanced. Additionally, the results garnered from the simulations indicate that the recommended MMPA technique has the capacity to yield superior solutions compared to several other widely recognized optimization algorithms. Scheduling with both DR and EVs with three cost components are considered, generation cost, reserve cost, and initial unit cost, amounting to $740.11, $9.61, and $6.07, correspondingly and it can lead to decreased emission levels and increased incentives for proprietors of EVs, responsive load participants, and RES.