Check if user is flagged in rules
You can create a Rule with the event "User account page is viewed". Then, you can add the required condition as follows:



So you select the current user as the user that should be Flagged and select the visited user as the person that should have done the Flagging.