You have to know jog_dial adresses in RAM for your camera. Then you can peek() them and compare. I did it for SX130IS. It follows:
function get_jogdial()
u=v
v=peek(0xC0240104,4)
if v>u then
jogdial_change=1
end
if v<u then
jogdial_change=-1
end
if u==v then
jogdial_change=0
end
end
However, you need to find your own adresses for your camera. It's to be done by reading some files of the source code, I don't remember which. Probably a kind of patch for the specific camera or something.
Function returns -1 if jogdial was turned left, +1 if turned right and 0 if it was not turned since last check. Note, that wait_click() will not work for jogdial.
It would be nice to have get_jogdial() function built in CHDK...
EDIT:
As I'm reading this code I'm sure, that u and v must be initialized somewhere before (otherwise v would be a nil value at start and v>u would return an error).