Hi Raven,
Where is the problem? You have already all you need to fulfill the task.
Either you add a nested IF statement (if layer is background than true ELSE switch layer state), or you change your logic to a SELECT CASE loop (case background: layer = true, case THISANDTAHAT: do something else).
HTH,
Y.