Thread count of process x?
ps on OS X takes different options than ps on Linux. Please have a look at man ps to see the detailed list of supported keywords. For threads I found the following (but I don't know whether this is the information you are looking for):

 wq         total number of workqueue threads
 wqb        number of blocked workqueue threads
 wqr        number of running workqueue threads


PS: I would recommend to first test any unix level commands in Terminal/bash and only move to AppleScript once they are working as expected. You are far more flexible in bash and also may get better/more helpful error messages back.