transition_comment_status gets called when untrashing comments

The transition_comment_status action will get called whenever the status of a comment changes from one thing to another thing, regardless of what those things are.

If you don’t want it to take action when going from trashed to approved, you need to recognize when the $old_status is trashed and not take action at that point in time. Right now, you’re only checking that the $new_status is approved, you’re not checking what the old status was.