Requies SuperMacro:
/script if not buffed("Ice Block", 'player') then cast("Ice Block") end
/unbuff Ice Block
Alternatively you can combine the two into one macro by using shift-modifier to save a bind:
/script if IsShiftKeyDown() then CancelBuff("Ice Block")else if not buffed("Ice Block", 'player') then cast("Ice Block") end;end