This is a very old thread, and the sample code above apparently suffers from the same problems discussed in https://webwork.maa.org/moodle/mod/forum/discuss.php?d=497 . Until today the Wiki page https://webwork.maa.org/mediawiki_new/index.php?title=AdaptiveParameters still had sample code which would lead into those problems. The Wiki page has been updated to use the modified approach provided in the other thread to avoid the issues reported there.
The main change is using
if ($self->{_filter_name} ne 'produce_equivalence_message') { }to envelop the adaptive parameter code.