Been digging around in the ejabberd code base a little, think I found out how you would accomplish this:
ejabberd_sm:get_user_resources(User, Server)
That will return an empty list if the user isn’t logged on, and if they are logged on, it will return a list containing all the resources that the user is logged on with. So if you’re just looking for whether they’re logged in or not, checking the size or contents of the list returned should tell you that. This is actually published here: http://www.process-one.net/en/wiki/ejabberd_sm/, as part of the session manager API, I just didn’t know what it’s behavior would be for users that aren’t logged on until I saw it in action in some of the ejabberd source code.