Real-time processing demands are also increasing significantly with the proliferation of Internet of Things (IoT)-based smart systems. At the same time, the volume of data generated, and computational workload are also increasing significantly. In this regard, fog-cloud architectures are proposed to alleviate the excessive load on cloud servers. However, since the resources of fog nodes and the virtual machines on them are limited, efficient management mechanisms are required. As the volume and amount of data increases, computational and processing costs increase, and delays are inevitable. However, these requirements need to be resolved to increase QoS and customer satisfaction. One of the most important criteria to achieve this goal is accurate and effective task allocation and scheduling. Since the scheduling is a type of NP-hard problem, the metaheuristic approach is used. In this study, an Enhanced variant of the Sand Cat Swarm Optimization algorithm (ESCSO) is proposed to efficient scheduling according to tasks priorities and a suitable fitness function based on completion (makespan) time, energy consumption and execution cost parameters is defined. In the proposed algorithm, global search ability and population diversity of the SCSO is improved based on the chaotic map. Also, its exploration and exploitation mechanisms are enhanced based on Brownian and Levy motion strategies. Besides, the control mechanism of the phases transition is redefined to increase balancing performance. The proposed method is compared with SCSO, Improved Artificial Hummingbird Algorithm (IAHA), Discrete Moth Flame Optimization (DMFO), Enhanced Particle Swarm Optimization (EPSO), Chaotic-Whale Optimization Algorithm (CWOA), Modified Harris-Hawks Optimization (MHHO), and Hybrid Artificial Ecosystem Optimization and Salp Swarm Algorithm (AEOSSA) algorithms and analyzed on the three parameters in two different scenarios. The obtained results present that the ESCSO algorithm outperform others in all cases.