No, you can't search a queue (Beanstalkd calls them 'tubes'), only get a job (though you can PEEK, to see what the next job would be).
Since you can watch more than one tube at a time though (and get a job from any one of them, depending on priority and age), you could create a tube that would only every contain a type-b job. Then it turns into a simple count - stats-tube [tube-name(eg 'type-b-jobs')]. If that tube has a job in it, it's a typ-b job, and so you can go on with the type-a jobs.