We have analyzed the requirement and found that IsExternal and ExternalTaskProject properties are working fine as they can be used to filter the external tasks and their respective project files. Following code filters all the external tasks and just prints the local tasks whether the linked project file is in-place or not. It does not effect whether link is broken or not to the external task during filtering tasks in the sample code.
Please give a try to the following code and let us know if it fulfills your requirement. Otherwise please elaborate the issue more and send us your compilable console application code which reproduces the issue.
//Create a project reader instance
ProjectReader reader = new ProjectReader();
//Call read method of project reader object to get project object
Project prj = reader.Read("TASK_418064\\del2.mpp");
//Declare ChildTasksCollector class object
ChildTasksCollector collector = new ChildTasksCollector();
//Use TaskUtils to get all children tasks in RootTask
TaskUtils.Apply(prj.RootTask, collector, 0);
//Parse all the recursive children
foreach (Task tsk in collector.Tasks)
Console.WriteLine(tsk.Id+ " : " + tsk.Name);
Thanks for your patience and we are sorry for any inconvenience caused to you in this regard.