Exclude devices from scene when activating

I would like to be able to temporarily exclude devices from a scene. For example, say I manually turn up the brightness of my dining lamp at dinner, and an automated sunset scene would normally trigger it to turn on at 10%. I obviously don’t want the lamp to dim while I’m eating and would like to be able to exclude the lamp from the scene under that condition. Another common scenario would be not to turn off the lights when an occupancy sensor shows someone is still using a room.

I imagine this scenario, wanting to temporarily override automations, is a fairly common one, and I welcome other approaches that people have used.

This script seems like a good basis for a solution, but I’m not sure if/how I could apply the concept to activate the devices in a scene with exclusions. Thanks for any help/guidance.