tell application "System Events"update:
tell expose preferences
tell spaces preferences
set spaceset to item 1 of (get properties as list)
set spaces enabled to (not (spaceset as boolean))
if spaceset is true then
say "Space turned off"
say "Space turned on"
After upgrade to Snow Leopard this script didn't worked.
Later I found out 'item 1" should be modified to "item 5"