Certainly:
Have a look at mail's Dictionary: (script editor -> File Menu -> open Dictionary... -> choose Mail or click the Mail icon from the Library (Command-Shift-L))
Disclose the 'Mail' entry -> disclose the 'Classes' entry and select the 'Application' entry.
On the right you'll see all the 'properties' that the Application has. One of them is 'Inbox' which represents the "top level inbox" (i.e. an aggregate of all your inboxes.)
If you go back to the left of the window and disclose the 'Message' -> 'Clases' item you will see that there is an item called 'mailbox' - if you select that you'll see all of the mailbox class's properties. One of them is 'unread count'.
So - in fact it's quite easy:
Code:
tell application "Mail"
get the unread count of the inbox
end tell
or even shorter:
Code:
tell app "mail" to get unread count of inbox
Seriously - dig around in the Dictionary of apps you want to script - it's the only way to find out how the app "works"