ScopDetection: Use isTopLevelRegion

Contributed-by: Star Tan <tanmx_star@yeah.net>