There are two ways in which a Test Clip that is used in more than one Test Composition, or in more than one location within the same Test Composition, can adjust its behavior according to the location in which it is playing:
Method 1 - Use of Custom Properties (preferred)
Your Test Clip, as well as the items in your Test Clip, can contain Custom Properties. These Custom Properties can be used to insert values into Messages and Browser Actions before they are played. In addition, any Scripts in your Test Clip can check the values of those properties and change their behavior accordingly.
When a Test Clip is added to a Track in a Test Composition, you can specify what initial values are to be set for the Test Clip-level Custom Properties and for the System Properties of the Targets within the Test Clip. (This is somewhat akin to passing parameters to a subroutine.)
After the Test Clip has been placed onto a Track in the Composition Editor, follow these steps:
Note that you cannot directly set the Custom Properties of other items inside the Test Clip (such as Messages or Browser Actions). However, a Script inside the Test Clip could copy the values from the Test Clip Custom Properties to other Custom Properties, if the other items were not using Test Clip Custom Properties.
See the question "How do I dynamically or programmatically substitute a value into a Message or Browser Action before ..." for more information about how to use Custom Properties in Messages and Browser Actions.
Method 2 - Checking the location via Scripting (not recommended)
A Script can programmatically traverse the object hierarchy of the Test Composition in which it resides, and can determine things such as the names of the containing Track, Band, or Test Composition, or the instance name assigned to the containing Test Clip. See the Scripting documentation for more details.
The Script could then adjust its behavior based upon its determination of where it is being used. This would allow the Script to modify Messages or Browser Actions, or change the values of Custom Properties used by Messages or Browser actions, or change the values of System Properties. For more information on how a Script can modify Messages or Browser Actions or change the values of properties, see the Scripting documentation, as well as the answer to the question "How do I dynamically or programmatically substitute a value into a Message or Browser Action before ..."
This methodology is not recommended, however, because if someone unaware of this changes the name of the Test Composition, Track, or Test Clip instance, or makes a copy of the Test Composition under a different name, the logic could be inadvertently broken.