Couple of suggestions:
1) Locate the spot on the shaft where the set-screw lands and grind a flat on it to help it hold position.
2) Instead of an Allen head, find a longer bolt with a square head and use an open end wrench to get it tight.
3) If the sprocket is worn and has a lot of slop or is out of round or the keyway is worn, you need a new part. In fact the old key may have shown you a lot of wear on it. If the sprocket or shaft is worn,wrap some steel shimming on the shaft and pack it tight.
4) Drill the shaft and drive in a hardened slit pin or use a shear bolt.
5) Mark the head position of your Allen head. If it still loosens up, did the head turn or did the base wear ? If the head turned, use a longer bolt and add a locking nut.
1) Locate the spot on the shaft where the set-screw lands and grind a flat on it to help it hold position.
2) Instead of an Allen head, find a longer bolt with a square head and use an open end wrench to get it tight.
3) If the sprocket is worn and has a lot of slop or is out of round or the keyway is worn, you need a new part. In fact the old key may have shown you a lot of wear on it. If the sprocket or shaft is worn,wrap some steel shimming on the shaft and pack it tight.
4) Drill the shaft and drive in a hardened slit pin or use a shear bolt.
5) Mark the head position of your Allen head. If it still loosens up, did the head turn or did the base wear ? If the head turned, use a longer bolt and add a locking nut.