Modelling the merging history of binary SMBHs in hierarchical models of galaxy formation