This isn't "very basic", it is a rather advanced topic.
I'm assuming that you want the program to do this, in runtime. As far as a flash programming firmware is concerned, the flash is divided into banks, which are in turn divided into pages, which are in turn divided into segments, where each segment is the minimum amount of flash memory that you can erase before writing to it. The nature of flash memory is such that you must always erase a cell before writing new data to it.
How to do the actual flash erasing/programming is described in the manual and various app notes. There is no doubt some examples on this site, too.
The main problem you are facing is that the code that executes the actual flash erasing/programming cannot be located in the same flash _bank_ as you are currently accessing. If you attempt this, you'll get strange errors where the program freezes etc.
I don't know how many banks there are in your particular S12 derivate, if there are more than 1, you should be able to place your flash erase/program code in the bank that isn't programmed. If you need the code to program any bank in the MCU, you will have to duplicate it for each bank.
An alternative is to execute the code from EEPROM, since you have it available. The last resort is messy and possibly unsafe (but preached by the Freescale app notes), and that is to copy-down the flash programming code into RAM and temporarily execute it from there.
The amount of data you can copy before refreshing the watchdog depends on what flash pre-scaler clock you are using. The timing is specified in the manual, if I remember correctly, the flash must have a clock between 150-200 kHz. And of course, it depends on what watchdog time you have set, as well.