You can overridde beforeAction() in your base controller (components/Controller.php). You receive a CAction object as argument, so you can check the action Id. You can also check the user status and set $this->layout (not $layout!) accordingly.
EDIT: And remember to return true, or it will cancel the action.
Oh, and if you just want to override your layout in some actions, you don’t need to override beforeAction - just set it with $this->layout in the respective action.