I wrote a post about how you can create your own stateful widgets using Shortcuts with Control Centre in macOS 26 Tahoe, including an example of creating a caffeinate control:
https://andrew.kerr.id.au/2025/use-the-rename-action-in-shortcuts-to-show-status/