I think there is no way of knowing this in Asterisk dialplan. The “include =>” statements are read only when Asterisk is parsing the dialplans on boot or on “dialplan reload”.
include needs to be encoded in the internal data structures. It is #include that is resolved at load time. However, I agree that the use case is needed here.