I've figured it out already. Suppose the ancient wizards were powerful. Like REALLY powerful. If that's the case and at least one is still alive, then he could donate his magic to bring him back. But in order for that to work, we must assume the following: human souls contain lots of determination, but very little magic; monster souls contain very little determination, but lots of magic. That would explain a lot. But the key thing here is, that monsters don't need a body, their magic gives them a body. That's why they turn into dust when they die.



So, in a nutshell, the following ingredients are needed to create a monster: determination (very little of it), magic (lots of it), and a spirit. Flowey already has two, injected determination and Asriel's spirit (which also contains his memories). Spirit is the only thing that can't perish. Asriel's spirit was revived through Alphys's experiments, Chara's spirit was supposedly revived through Frisk's determination, even after so many years. The only difference here was that Flowey has his DT stored in the body of a flower, while Chara was stuck with Frisk all the time, because Frisk's DT was still locked inside of them.



So, as I said, Flowey has a spirit, he has determination, the only thing missing is magic. This is where the wizard plays his role - he most likey has enough magic to give away, which would count as a sacrifice, because probably the only reason that he's still alive after so many years is thanks to his magic, if he gives it all away he will instantly die of old age.



So yeah, there's only one issue though - Flowey has lots of DT, way more than any monster could handle. This is fine for a flower body, but destructive for a magic body. So some of it would have to be pumped out while the magic would have to be pumped in. If that's done correctly, then I guess Asriel will have his soul back.



And I have a proof that it will work this way - taking the soul of a living monster would require an incredible strength, so at the end of pacifist route Flowey took the 6 souls, and then proceeded to take the souls of all monsters in the underground - this is because human souls couldn't do what monster souls can - give sufficient amounts of magic, because human souls are filled with DT instead.