Script that incriments Dimmer brighness_pct value from 1 to 255?

There is and it involves using repeat

FWIW, given a choice, it would be better to have lights that support transition natively. Home Assistant sends far fewer commands to the device compared to the technique you’re considering to use.