Hi Gregory,
I have wired the sample with BDM and power source - looks ugly however works.
now I have loaded your latest code.
as I do not have anything hooked to the mcu, I had to replace your clock init whth
//hal_clk_init();
ICS_C3 = *(unsigned char*)0xFF6FU; //ICS trim
ICS_C2 &= (unsigned char)(~ ICS_C2_BDIV_MASK);
I have disabled the wdog, your code was missing the wdog unlock sequence which is not correct
WDOG_CNT = 0xC520; // write the 1st unlock word
WDOG_CNT = 0xD928; // write the 2nd unlock word
WDOG_CS1 = 0;
I am calling the eeprom functions from the main loop controled by global variable "operation" that I have made for this purpose.
hal_eeprom_write_4_bytes works ok on my side
hal_eeprom_erase_4_bytes is erasing only first sector (two bytes), you need to exclude the alignment control that you have placed there and erase in sequence both sectors that belongs to memory space (4 bytes) you want to erase - take a look into AN at page 6; segmantation is sector or whole block...

I have tested the debugger for freezing, I have noticed it occurs when fast toggling between run and stop, it might be due to propagation delays in eclipse (I have quite fast PC so it is not so obvious here for the first sight), however there were no freezes when stepping (F5/F6) at all.
I have also enabled the EEPROM preservation to exclude eeprom overwriting when debug session toggling (it is in propoerties of Multilink connection).
so as a conclusion - I think your issue was the watchdog, then you need to update the erase function and it might be ok
Pavel