TL;DR:
JavaScript side: Add hidden input fields named myplugin_comment_meta[‘foo’] to the commentform element. Example.
PHP side: Add preprocess_comment filter callback and add $_POST[‘myplugin_comment_meta’] array items to the comment_meta array in the returned value. Example.