A stalker whose actions drove a grandmother to consider suicide and move home has been given a community order.