Add lines to item tooltip safely

Adding lines to an item tooltip is rather tricky, especially when you get into recipes and other items that behave odd. The below code snippet allows you to add lines while ensuring they are only added once.