If interest rate is 0%, you would have to return the same 1000$. You incur loss of 30$.
The *real* interest rate was 0%, which means that with a deflation of 5%, the NOMINAL interest rate is -5% (which is an absurdity, but why not).
It is in practice not possible to have a negative nominal interest rate, and deflation will always be less than the real interest rate normally, so that the nominal interest rate is still a positive number.
And now consider that you don't borrow but have $1000 as your own money. With the deflation of 5% you will get back only $970. You loss is same 30$, and in both of these cases you end up with less money than you had before.
Because we are in the absurd situation of a negative nominal interest rate. If there is a negative nominal interest rate, you simply keep your money ! It would be absurd to invest into something that has less ROI than the deflation rate, which gives you a free interest.
However, that situation cannot last. Because deflation (in fixed money supply) comes essentially about from the fact that the economy GROWS, and that more stuff has to be bought with the same quantity of money (assuming velocity more or less constant).
If the economy grows, it is normal to have a positive real interest rate, because the return on investment is normally HIGHER than the economic growth. So normally, the real interest rate, which is of the order of the average return on investment, is higher than the economic growth which induces deflation. As such, the nominal interest rate, which is equal to the real interest rate diminished with the deflation rate, will still be positive.