here is an example on how you can achieve this using a floating menu:
dim4.bttpreset (13.3 KB)
//edit: updated to not show on launch
It dims everything except the active window when you press cmd+shift+1 and undims when pressing cmd+shift+2. It does this by placing a full-size translucent empty floating menu behind the active window. The level of dimming can be changed by adjusting the opacity of the floating menu background color.
You could even completely blur out everything via the blur background option: