You can do it that way, but it’s not the most efficient. It will work fine and most users won’t notice any difference though.
If you’re any good with SQL I’d recommend that you write your own query to pull in the values. That way it’s a single query executed once and output rather then a loop and possibly a whole bunch of queries running each time. As a complete guess/example…
SUM(meta_value) AS overall
WHERE comment_id = '".$comment_id."'
AND meta_key = 'overall'
I’ve made a few assumptions there, like the attribute name, but that’s the general idea of how it’d work.