Insteon Dim Up/Down

I’m working with a few Insteon dimmer devices and I had a question or two to see if anyone has come across these issues before.

First, when you hold a dimmer button Insteon sends a “begin fade” command and an “end fade” when you release it. I use this by linking a button on my dimmer keypad to a fanlink light so when I hold the keypad button the light fades up and down. Is there a reliable way to implement this in openhab?

This next question ties into that. I was experimenting with some of the sample rules and there is one to make a light fade on and off three times by using a loop with a counter and sending the counter as a command to the light. Kinda like this:

rule "pulselight"
when
Item DebugSwitch changed from OFF to ON
then
var Number pulseDimmer = 1
var Number i = 0
var State InitialBrightness = Light_GF_Living_Ceiling_Brightness.state
var State InitialState = Light_GF_Living_Ceiling.state
while (i<3) {
while(pulseDimmer<100){
pulseDimmer=pulseDimmer+9
sendCommand(Light_GF_Living_Ceiling_Brightness,pulseDimmer)
Thread::sleep(100)
}
while(pulseDimmer>1){
pulseDimmer=pulseDimmer-9
sendCommand(Light_GF_Living_Ceiling_Brightness,pulseDimmer)
Thread::sleep(100)
}
i = i+1
}
sendCommand(Light_GF_Living_Ceiling_Brightness,InitialBrightness)
sendCommand(Light_GF_Living_Ceiling,InitialState)
end

The issue I’m having is that it updates slow at times so the fade on is not smooth and it takes longer than it should to complete the three flashes. Is this an issue on my network or is there an optimization I need to perform?

Thanks for reading,

Matt