And in openhab.log? I bet you are seeing errors there when you save the rule. As @rossko57 points out, that’s Rules DSL code, not ECMAScript.
If you are looking for a pre-made scenes management solution, and are running OH 3.2 M3 or later look in the Marketplace. There are some rules and UI widgets that let you set your devices how you want them to be in the scene then save that as a scene that can be activated later, all from the UI.
But if you are just learning how to create rules, you just need to pay special attention to the language chosen for a Script Action/Condition and the code you are trying to use.