Even if your code is correct, it is extremely bad practice to use the same variable names for the loop indices and for local variables within the loop. Certainly any experience coder will pause when looking at that code and start to wonder if there's a bug, as Wallter did. Make the life of the reader easier, remove the ambiguity:
n = 450*450;
for i = 0:1:n
for j = 0:1:n
ind1 = mod(i+1, n+1) + 1;
ind2 = mod(j + S(ind1), n+1) + 1;
S([ind1, ind2]) = S([ind2, ind1]);
In the calculation of ind2 (your original 2nd j), it is unclear if you meant to use the loop index i or the i calculated on the previous line. Your code would have used the i calculated on the previous line, so i have done the same.
Note that your S needs to have n+1 elements for your code to work. Are you sure you didn't mean mod(..., n)?
edit: As for speeding it up, no it's not possible because of the dependence on S(ind1) in the calculation of ind2. And since you want to do swaps = 41,006,655,001 swaps ~= 41 billions swap, it's going to take a loooong time, but matlab will eventually get you the result. It takes about 0.3 seconds on my machine to do one i loop, so in about 18 hours you'd get your result. Do you actually need to do that many swaps?