First of all, keep track of the TB inventory in offline mode as well. Keep it in sync every time Locus goes online, like loading PQs, upload logs etc.
While logging a cache ask what happened to the TBs in your inventory, store the last action as default (handy for tracking TBs). Store the TB actions in offline logs as well. Log TBs when performing the bulk log (will not work with uploading field notes just like pictures, I know).
If it runs out of sync (for example someone grabbed a TB from you) ask to agree to the change, finish the old logs first or stop the process and ask to fix this online using the groundspeak site and offer a "sync my TBs" option to continue.
Optional (extra tab in the logging dialog) ask what happened to the TB that are listed in a cache. Ask for the code to discover or take them, write a note on the TB page if the TB is missing.