Unfortunately there isnt a way to avoid paying LMI, (or selling, as you have referred to).
LMI is going to be pretty steep, its going to eat into most of your $40k 'profit' on the purchase.
the good news is, if you rent out the new purchase, you can claim the costs and the LMI over the...