The last steam engine built on the Isle of Man has made its way home after a major restoration.