Instead of overriding OnSaveDocument, you should put your code in the Serialze method of the document class. The default Serialize method has
if (ar.IsStoring())
{
...
}
else
{
....
}
Just put your code to save/load in the correct part of the if/else.
Hope that helps.