1) I created a brand new Mailbox - On My Mac
2) In Terminal - ls -al ~/Library/Mail/V2/Mailboxes
The new mailbox folder DOES NOT exist - even though it shows in the Mail sidebar.
The new mailbox folder DOES exist in ~/Library/Mail/V2/Mailboxes/.mboxCache.plist
3) Select another maiilbox from which to drag and drop a message.
The new mailbox still DOES NOT exist in the Mailboxes folder.
4) Drag and Drop a message into my brand new Mailbox.
Voila! The 'ls' command reveals that the brand new mailbox exists in the Mailboxes folder.
I navigate down the new mailbox to the Messages folder and, sure enough, the message file exists.
5) In Mail, I select the new mailbox and it shows one message.
The Mail app says there is 1 message in the mailbox.
I run the AppleScript to count the messages and it reads 1
So far so good.
6) While still in the new mailbox, I now drag -n-drop the only message to another mailbox.
The Mail app shows the message disappear and the count is 0 - fine
However, I do an 'ls' in the new mailbox folder and the message still exists.
AND, when I run the AppleScript, the count still reads 1 - NOT fine
AND, a the new message exists in the drop target mailbox.
So, at this point the message exists in the drag source mailbox AND in the drop target mailbox.
7) I now click on the drop target mailbox
In the Mail app, the message exists in the drop target mailbox.
In Terminal, 'ls' reveals the file exists in the drop target mailbox.
In Terminal, 'ls' reveals the file DOES NOT exist in the drag source mailbox.
Conclusion, Mail app uses .mboxCache file to store new mailbox creation UNTIL a message is actually stored in the mailbox, then the app physically creates the mailbox folder. Subsequent operations performed while residing in the mailbox may not take place - are cached - until the user switches mailboxes.
I still see no way to code for this caching behaviour in AppleScript.