If I have an encrypted wallet.dat file under bitcoin core, and I frequently use the getnewaddress and addwitnessaddress commands, how often should I backup the wallet.dat file?
If you are using the latest Bitcoin Core, then you should make a new backup every 1000 addresses. That is the default keypool size and you should make a new backup whenever the keypool runs out. This should be done regardless of HD or non-HD wallet, and even more so because you are using addwitnessaddress.
Also, you will need to unlock your wallet every 1000 addresses so that the keypool can be refreshed.
This was the case with the old format, as far as I know, since bip32 was introduced (I think this is the bip for the current HD format) then you no longer need to be making backups each time, but I don't know how this would be the case to be honest.
Even if HD mode is enabled, and you make receive a transaction with a newly generated key, how can a former HD enabled wallet.dat know that this transaction was received, if the key was never generated? same goes for sent coins. This confuses me a great deal. I think it has something to do with pre-generated addresses that you don't see but already are there or something along the lines... it's weird to think for a non coder. I would like achow101 to explain this in laymans.
My advice is that even if you are using HD mode, you keep making backups and don't delete previous backups, just rename them.
You should keep making backups regularly. What HD wallets do is that you can still use old backups and still generate the private keys that are not in the keypool at the time of backup.
The wallet contains a field which has the latest block height that the wallet is synced up to (as in it has the transactions for the wallet up to that block height). So when restoring, Bitcoin Core will know where it should begin rescanning the blockchain to get any new transactions.
Because OP is also using addwitnessaddress, older backups will not know about those witness addresses (the scripts themselves must be added to the wallet) and addwitnessaddress will need to be called again on every single address generated.