Fire light flicker script

I’ve created a script (copying from a previous community post which I have now lost) which makes a nice firelight colour. However, it is a bit hard on my hue network - causing delays on my lights. I’ve increase the transition time by a second, but is there any way to improve it other than providing longer transitions.
Second question, do I need the delay or will the script automatically wait out the transition time?

alias: Fireplace Light
sequence:
  - repeat:
      while:
        - condition: state
          entity_id: input_boolean.fireplace
          state: 'on'
      sequence:
        - service: light.turn_on
          target:
            entity_id: light.fireplace
          data:
            hs_color:
              - '{{ (range(30, 40) | random) }}'
              - '{{ (range(80, 100) | random) }}'
            transition: '{{ (range(1, 4) | random) }}'
            brightness_pct: '{{ (range(20, 35) | random) }}'
        - delay:
            hours: 0
            minutes: 0
            seconds: 4
            milliseconds: 0
mode: restart

It’s probably better to run that locally.
So somehow create the same with a ESP that changes the color of a light(strip).
That way you would not limit yourself with the effect either. By just looking at the code it seems to be not very realistic (?) with a four second delay.
Fires can “flame up” quite intense and be “low” the next second.

Unfortunately I’m using a hue play, instead of LED strips, as I found it on sale.
Edit: I agree, the several second delay doens’t look very ‘fire’ like. But it adds a nice feel.