How to properly add function called by action-hooked function to functions.php?

This looks good. If we assume get_exclusion_IDs_for_cats_by_name($cat_names); works correct then you are doing it right.

Your question may be rephrased like this:

Can I call other functions inside the custom actions?

And the answer is yes. The only thing you need to be careful is that your other function is available from where you call it.