Hi ... just want to help out here a little by first making an attempt at translating your question. If you can, please confirm that this attempt is accurate , or perhaps close ...
- You created two fields on the Case entity: "Health" and "Flag Color" (so values like "Poor Health" and "Red" - maybe these are option sets)
- You created a web resource that you deployed on the Case form wherein if someone chooses a value for the Health field like "Poor Health," your web resource (JavaScript?) automatically changes the Flag Color to "Red" or some corresponding value.
- You did that, but now you want to perform that same logic using similar fields on the Account record that is related to the Case. Such that if an Account, at any given time, has a Case with "Poor Health" and flagged "Red" the Account is now flagged "Red" and considered to be in "Poor Health."
Is that it?
If so, then suggestion 1 is to use a Global Option Set for your two fields - Health and Flag Color -- and then extend your web resource logic (JavaScript) to refer to the Account that is populating the lookup field to Account on the Case entity. You could start more or less with this to get you toward that concept.
Something to consider, as others have mentioned in other threads, because there is a 1:N relationship between Account and Case, every time a Case for a given Account is updated in this fashion, the Account will also be updated. So that means that the Account status (Health and Flag Color) will always be the "current" status as determined by the last Case record. If you are OK with that design - perhaps that is your intention - then great.
If I helped you out, please mark it as the answer - thanks and best of luck with your Dynamics 365 deployment!