@Gayaanan ***********
you need to coordinate the whole thing so you can cancel the ED extension and have time to exit the country to go apply for your visa
in bangkok you can cancel an extension 2 weeks or so early so you just get paperwork from your school saying you stop on xxx date, go to the immigration office cancel the extension, they will stamp you in until the date on the paperwork
BUT
Not all offices work like that and some cancel the extension the day you apply to cancel it no matter what the date on the paper says from the school
CHECK with your school and ask them they should know