When you pick up your new passport at the embassy they will give you a document basically asking the Thai immigration officer to transfer your visa stamp from your old passport into your new one. So once you pick up your new passport you have to go back to immigration again, but it's not a big deal. After that you just extend as usual.
Do the pages have "endorsements" written on the side of them? My husband had 4 pages left and was denied his ED visa extension stamp at BKK immigration last month due to not having enough pages left in his passport. The official told him that he couldn't use the "endorsement" pages so my husband ended up overstaying his visa by a few days bc of the time it took to get an emergency passport, and of course this happened on a Friday afternoon, etc.