EDIT:
Updated and improved version HERE.
Old versions:
The idea here is for an action to repeat for as long as a key is held. These all achieve the same thing in slightly different ways.
Hotkeys:
6 - Hold to Repeat - Hotkeys.kmmacros (30 KB)
USB Device Keys v1:
6 - Hold to Repeat - USB Key v2 (Standalone).kmmacros (34 KB)
USB Device Keys v2:
If you don't like using Cancel all Macros (as in v1, above) and don't mind using two macros:
6 - Hold to Repeat - USB Key v1.kmmacros (33 KB)
This one starts triggering and stops when a variable changes.
6 - Hold to Repeat - USB Key v1 - Detect.kmmacros (29 KB)
This one changes the variable on key release.