You can iterate over the list of columns in the data window and check the Key property using descriptive or dot notation:
<DW Control Name>.Describe("<Columnname>.Key")
or
<DW Control Name>.Object.<Columnname>.Key
This allows you to find out whether a column is included in the selected list that you see in the data wizard, in the menu item Rows-> Update Properties-> Unique Columns (s):
Here are the docs for this property:
http://infocenter.sybase.com/help/topic/com.sybase.dc37783_1150/html/dwref/CAIBHFGF.htm