Using an ability whenever it is up

I am really new to this whole macro thing and I just wanted to do a simple thing.

I created a macro that casts ‘Shield Slam’ and then ‘Devastate’. My intention for this macro was to use ‘Shield Slam’ whenever it is up and when it is on CD use ‘Devastate’. Now when I click my macro it tries to cast ‘Shield Slam’ which is fine. But should I leave a fight and Shield slam was the last ability I used, then this macro will start the next fight with ‘Devastate’ although ‘Shield Slam’ is not on CD, anymore.

Is there a way to change my macro to give ‘Shield Slam’ absolute priority?

Thanks in advance!