Just as a rule of thumb. I would say, if your code or table is set up in such a way that it depends on column order, you are probably doing something ugly. It might work, but there is probably a more elegant, faster way to do it.
Order of data should really only be considered at the end of a script when you choose to display the data (and for the most part that's not even necessary since it's usually better to show the data in a graph and not in a table).
This being said, ugly code that works is still good code. In your case, assuming you have no control of how the data-tables are being fed into your script this may be the simplest solution. However, you could still condense the code like so: (Notice how I never need to know the column number).
colFound = 0;
ncols = ncol(dtSummary);
for(i=1, i<=ncols, i++,
if(colFound,
if(devicePass,
devicePass--;
Insert Into(y_cols, i, i);
,
break()
)
);
colName = (Column Name(i) << get name);
if(colName=="Vd", colFound=1);
);