The coloured Petri net formalism has been recently used to analyse and optimise manufacturing systems making use of the state space (SS) analysis. This approach has great potential for scheduling and production planning purposes when it is properly implemented. In this article, an improved version of the algorithm known as the time line search for optimising the makespan of manufacturing models is presented. The algorithm has been developed for the use in a compact SS of coloured Petri net models in order to analyse the highest possible number of manufacturing configurations for the improvement of the makespan of a production system. The proposed algorithm can be used for the developing of decision support tools in manufacturing or operational decision-making.