Midlothian councillors ruled the structure could stay while the owner seeks an alternative which satisfies planners.