A Lybster man who behaved in a threatening or abusive manner at Caithness General Hospital has been ordered to carry out 130 hours of unpaid work.