The most common grades of neodymium magnets will demagnetize at around 60-80°C. Even if they could handle the temperature, they wouldn't stay in place well since they are smooth.
Epoxy and super glue both work well for gluing the magnets in a hole. Rough up the back side if the magnet so the glue has something to hold on to though.
As long as you have a backup image, you can just order a new flash chip from Digikey and restore the backup.