The problem we found is that FF_Scan is not detecting the memo file corruption at all, so whilst I was doing something like your code snippet, it basically didn't work.
My difference was that I wanted to know if there was a problem, then have this raise a support call needed screen, rather than just fix the problems and us not know about it.
Anyway, it didn't work, and now Xitech have decided to stop answering my emails - perhaps this is connected with the temperatures approaching 90 or more in the UK at the moment. Ironic that they are having the best summer for years and we have crossed the globe to miss it.
Thanks
Simon