That example of mine does just what you ask...
And it works...
That example should be executed like this:
[vehiclename] exec "blah.sqs"...
Here's an example just for debugging so you see that it works:
_vehicle = _this select 0
; check if vehicle is in base class "Air", if so, goto label #air
? ("Air" countType [_vehicle]) > 0: goto "air"
; if not, goto label #ground
goto "ground"
#air
hint "air"
exit
#ground
hint "ground"
exit