I'm struggling with the exact same problem for my addon atm, and when I looked at the code of SPON Status last night I saw that spooner used !isNull gunner and vehicle
emptyPositions "gunner".
Basically when there is a gunner, the gunner command returns a non-null value (it returns the object in the gunner seat), but when there is no gunner in the vehicle or when the vehicle does not have a gunner slot it returns null. To detect if there is a gunner slot when no one is in a gunner slot, you use " someVehicle
emptyPositions "gunner" ", which will return 0 if there are no gunner seats left (or there weren't any to start with), or a value above 0 (could be a multi-turreted vehicle).
I'll try to make some code examples later, because I haven't really had the time yet to study his code to detail.