Phil,
This is very odd! If the Mail folder and its Mailboxes folder in which you found the missing On My Mac mailboxes is properly located at Home/Library then Mail accessing that should display them in the Sidebar. Make a Duplicate of the Mail folder you are examining, and drag that resulting copy to the Desktop for temporary backup.
Next, do the following: try removing the Envelope Index to force reindexing of all mailboxes -- see:
http://docs.info.apple.com/article.html?path=Mail/3.0/en/14019.html
If you only had POP accounts, then you only need deal with the Envelope Index removal, but if you have IMAP accounts, note their special treatment which will require removing the account folders. Removing the folders for IMAP accounts, but not removing the account in preferences nor removing the com.apple.mail.plist file means Mail will rebuild its universal index as it is recreating the IMAP account folder(s). Also remember that if selected to Keep copies of messages and their attachments considerable time will be needed to again download everything on the IMAP server.
But this reindexing may rediscover the On My Mac mailboxes.
Ernie