Text this: Stochastic Optimal Control of Averaged SDDE with Semi-Markov Switching and with Application in Economics