I’ve thought about this as well, but in my use case there is always strong (improving) connectivity within my maturing internal network (I just finished moving everything iot over to its own dedicated VLAN).
With that situation, I have decided to keep all logic centralized to keep it simpler for development and administration.
I have upon occasion run into a situation where one or more devices have trouble connecting or are not triggered properly, etc. That in and of itself is a valid reason to have the logic within some devices for the automation to talk locally to each other, but the better way to resolve such issues are to do what is needed to resolve the root cause. That is a double-edged sword because sometimes there is no way to resolve the root cause, but in that case you are stuck with thinking outside the box to use workarounds or slowly upgrade the hardware. And keep all the firmware up to date.
Local logic within devices to talk to each other directly in many cases might be more reliable and faster - but there are always drawbacks - when that is between Yolink devices for example, those two devices then cannot talk to any other Yolink device or HA. Even if you can use your own custom code in a device, such as with Shelly scripting, there is a limit to how much code can be used.
For any home automation, if it is across an entire household the entire situation is only as strong as it’s weakest part. Even if all of the equipment is top notch, one device going south can cause a network storm and bring the whole thing to its knees. (That’s just one of the reasons I switched over to a separate VLAN for IOT.) Therefore I have found the improvements that have the most effect are those which improve the speed and reliability of the entire network. My latest fix for instance, has to do with a bunch of Wemo smart plugs in a master bedroom. They would lose connectivity and cause no end of low WAF (Wife Approval Factor) when there is no power going to lamps which the spouse cannot then turn on. I do plan on replacing those smart plugs, but what turned out to be a major improvement was to replace the wireless access point to which they connect. In beefing up my network I had ‘temporarily’ (for about a year) instead of buying another WAP, had an old router in wap mode connected to my wired router. Replacing that old device with another centrally managed wap drastically improved the connectivity for those Wemo devices.
Even with centralized control I have found one scenario where local code is required. For a Shelly dimmer 2, for a light switch connected to it, for the switch to still be able to just turn the light on and off without HA or the Shelly app, a localhost API call within the dimmer configuration itself for “on” or “off” switch presses is required in the config for the dimmer to make a call to itself, but that is a unique case.
I can go on and on but just to clarify the above point, I am disliking the Wemo smart plugs because it takes them forever (if they do at all) to reconnect to a network, for example when a router is rebooted.
I digress here but one holy grail I am looking for is to make table lamps smart at the light bulb socket switch itself, such that if it is off, it can be turned on either remotely and also locally at the socket. With a smart plug that is turned off that’s not possible - and with a smart bulb that is not possible - and when the person is trying to turn it on, they are actually turning it off such that when the power through the smart plug is turned on the lamp then still does not go on because the person had just turned it off, etc. And even if a Shelly is put at the end of the wire near the outlet or in the basement of a lamp, the wire going from the lamp to the outlet needs to be at least three leads, never two, etc…
This may be an unending journey for some of us!