When you define your int's they default to 0 so you're straight away saying
Do until -520 < 0 which of course it is and the loop exits immediately.
[you should use the code option to display code by the way like this...]
Dim d, sa As Int
Do Until (sa-520)<0
d=d+1
sa=1400-(d*520)
Loop
Log(d)
Log(sa)