Hi Yuriy Dovgalyuk,
Did you use FRDM-KEXX Driver Library Package? And didn't modify it?
I have test KEXX_DRIVERS_V1.2.1_DEVD\kexx_drv_lib\build\iar\ke06\Flash_demo directly on my FRDM-KE06 board, I didn't meet your MGSTAT0 and MGASTAT1 set problem:

If you just use the KExx SDK drivers, before you do the flash operation, please disable the global interrupt, after the flash operation finished, you can enable it again.
Wish it helps you!
If you still have question, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------