When all the results were declared – after more than 16 hours of counting – the SNP had 58 MSPs – seven short of a majority.