Look at the User Preferences section (2.6) in README.dissector.
Basically when you register the preference you pass a pointer to a static variable in your dissector and this is updated with the new value.