If you want to automate Sunbeam against undead and ooze you can simply add "IF: TYPE (undead, ooze); DISSAV" at the end of your initial effect, like what I've got going on here:
Sunbeam; STURNRE; SAVEA: CON [SDC] (H) (M); SAVEDMG: 6d8 radiant; SAVEADD: Sunbeam; IF: TYPE (undead, ooze); DISSAV
Hope that helps :)