I think all you need to do to access the state is ItemName.state. There’s no need to “get” the Item at all, all Items are automagically injected into the script context.
You don’t always know the name of the Item. Sometimes you must construct it or it’s passed to you somehow. If all you have is the name of the Item as a String, you can’t use "itemName".state. You have to use the name to pull the Item from the registry.
In all the other languages this is much easier because both the item registry is part of the presets but also because the Items are imported not individually like in MainUI but in a structure.
So for JS one can use items["MyLights_"+someVar].state.
You can’t do that in Rules DSL. You have to pull the Item by name from the Item registry (which is the second example in the OP).
The answer is no. The why is it’s possible to post an update to an Item or send a command to an Item without the Item Object itself. That’s what those postUpdate(itemName, state) and the equivalent sendCommand Rule Actions do. They put the update or command straight on the event bus without needing to involve the Item at all.
But to get the state of an Item one must get that from the Item Object. I imagine it’s theoretically possible to do it with a Rule action too, but there are so many other things one may what to do with the Item a better approach would be to make the ItemRegistry available and/or provide some sort of structure to retrieve an Item’s Object given it’s name.
Again, this is all from the Rules DSL perspective. The other languages already have this covered.
This got a lot easier in 5.2.0, you can simply use Items.get(String itemName).state (assuming that you know that the Item exists so that it won’t return null).
I’m not really sure that there’s that much difference in “difficulty”/convenience between that and the array access offered by JS? You can of course also do Items.get("MyLights_"+someVar).state if you wish to.