First you write an if code:
If Me.FreeNormalBagSlots <4 || Me.DurabilityPercent < 0.5
Now you need to drag all your orders into this order in the right order. (Damn that sentence is crazy. Hope you understand it.)
so it looks like this:
If Me.FreeNormalBagSlots <4 || Me.DurabilityPercent < 0.5
-Fly to: somewhere in dalaran
-Sell Items: Put in the npc where you want to sell
-Mail Items: If you want to mail your stuff. Dont forget the set a mail recipent in your general hb settings.
-The repair order is a little bit more complex. You need to move to a npc that can repair and interact with it, then you need a custom action: Lua.DoString("RepairAllItems()"); , a wait timer right before that can help to avoid lag. In your PB folder is a profile called "Multiprofile" there is this code, you could just copy paste it.
-Put in more orders just how you like it.
Theeeeen there is another Order like this:
if Me.DurabilityPercent >= 0.5 && Me.FreeNormalBagSlots >= 4
this is the exact opposite of the other one, this one is true and will be executed if your char is ready to farm, i.e. has enough bag space and is repped.
if Me.DurabilityPercent >= 0.5 && Me.FreeNormalBagSlots >= 4
-Fly to: Put any point in your farm area here
-Change Bot: Grind Bot. This is important, you can choose the sub bot by hand, but yeah, if you are lazy, you can make the bot do it.

-Load Profile: THe one you send me