To satisfy all your requirements, you might need to write your own S-function. Then use the target disk to save the values at stop time and restore them in mdlStart when you start the model again.
You can use file system calls inside your S-function. Do the file IO in mdlStart and mdlTerminate. You can use malloc() to allocate the buffer. Save the pointer in a P-work variable. Match allocation in mdlStart with freeing in mdlTerminate or you'll see a memory leak.
This does require that you have a disk with a FAT file system on it. You'll be able to read/write the file with the data from the host to set up the initial values and recover the final values.