Instead of this method, couldn't you have just changed the default filename to something like xwallet.dat?
Then the old client would ignore the file and generate a new empty wallet.dat, leaving xwallet.dat untouched.
That still results in the same scenario: you roll back a version, and see "Balance: 0.00" and panic.