Hello chrisp,
Welcome to ZBC. 
You can get the SubDivision Count like this:
[If,[IExists,Tool:Geometry:SDiv],
[If,[IsEnabled,Tool:Geometry:SDiv],
[VarSet,maxSDiv,[IGetMax,Tool:Geometry:SDiv]]
[Note,[StrMerge,"There are ",maxSDiv," SubDivision levels"]]
,//else not enabled so no subdivs
[Note,"There are no SubDivision levels"]
]
]
And the state of the Dynamic Subdiv button like this:
[If,[IExists,Tool:Geometry:s.Dynamic],
[If,[IGet,Tool:Geometry:s.Dynamic],//Dynamic Subdiv is on
[Note,"Dynamic Subdivision is ON"]
,//else it's off
[Note,"Dynamic Subdivision is OFF"]
]
]
For the ZScript commands, the online reference is here and up-to-date:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/
HTH,
Marcus