Despite recent advances in targeted drugs and immunotherapy, cancer remains "the emperor of all maladies" due to almost inevitable emergence of resistance. Drug resistance is thought to be driven by genetic alterations and/or dynamic plasticity that deregulate pathway activities and regulatory programs of a highly heterogeneous tumour. In this study, we propose a modelling framework to simulate population dynamics of heterogeneous tumour cells with reversible drug resistance. Drug sensitivity of a tumour cell is determined by its internal states, which are demarcated by coordinated activities of multiple interconnected oncogenic pathways. Transitions between cellular states depend on the effects of targeted drugs and regulatory relations between the pathways. Under this framework, we build a simple model to capture drug resistance characteristics of BRAF-mutant melanoma, where two cell states are determined by two mutually inhibitory - main and alternative - pathways. We assume that cells with an activated main pathway are proliferative yet sensitive to the BRAF inhibitor, and cells with an activated alternative pathway are quiescent but resistant to the drug. We describe a dynamical process of tumour growth under various drug regimens using the explicit solutions of mean-field equations. Based on these solutions, we compare efficacy of three treatment strategies from simulated data: static treatments with continuous and constant dosages, periodic treatments with regular intermittent active phases and drug holidays, and treatments derived from optimal control theory (OCT). Periodic treatments outperform static treatments with a considerable margin, while treatments based on OCT outperform the best periodic treatment. Our results provide insights regarding optimal cancer treatment modalities for heterogeneous tumours, and may guide the development of optimal therapeutic strategies to circumvent plastic drug resistance. They can also be used to evaluate the efficacy of suboptimal treatments that may account for side effects of the treatment and the cost of its application.