Enhance script detection