Here is a basic example and some scripting ideas. You can see how I have this set up in the screenshot; the highlighted elements are inset an imported text inset.

Here is the code that writes the information that you see in the Console window. You could use this to make some kind of map of the elements in your document so you could determine if a particular element is in a text inset.
main ();
function main () {
var doc;
doc = app.ActiveDoc;
if (doc.ObjectValid () === 1) {
element = doc.MainFlowInDoc.HighestLevelElement;
if (element.ObjectValid () === 1) {
processDoc (doc, element);
}
}
}
function processDoc (doc, element) {
var textList, count, i, inTextInset, textItem;
// Get a list of elements and text insets from the document's
// main flow.
textList = doc.MainFlowInDoc.GetText (Constants.FTI_ElementBegin |
Constants.FTI_TextInsetBegin |
Constants.FTI_TextInsetEnd);
count = textList.length;
// Initialize a variable indicating the beginning and end
// of a text inset.
inTextInset = false;
// Loop through the list of text items and check each one.
for (i = 0; i < count; i += 1) {
textItem = textList[i];
// The start of a text inset.
if (textItem.dataType === Constants.FTI_TextInsetBegin) {
Console ("--- In text inset ---");
inTextInset = true;
}
// The end of a text inset.
else if (textItem.dataType === Constants.FTI_TextInsetEnd) {
Console ("--- End text inset ---");
inTextInset = false;
}
else { // Element begin.
// Write the element's name to the Console.
Console (textItem.obj.ElementDef.Name);
}
}
}