Grr if you changed some of the variables during a program you would still need to reset back to what they were before the program was run so I think the mapcar is still applicable.
Suggest use cond instead of all the if's
There is the LAYOUTLIST function that return a list with the names of available layouts:
(setq layoutOld (getvar "CTAB"))
(foreach layoutCrt (layoutlist)
(setvar "CTAB" layoutCrt)
;your action here
)
(setvar "CTAB" layoutOld)