What you did can't work because mirc cannot process anything else if a routine isn't finished. So it can't /dec the variable once a sec because until the routine is finished (which would happen
after the while loop finishes) mirc can't do anything else. But if the variable cannot be /dec'ed, the loop will never terminate... it's a dead end.
You'd better use timers for what you want. There is a way to do it in the loop, by checking $ctime ($ctime's value changes because it's independant of mirc), with something like this:
var %c = $ctime
while $calc(10 - $ctime + %c) {
.rline @PRE-TIME 4 This window will close in: $ifmatch seconds
}
but I wouldn't use it because mirc remains frozen for 10 secs, while /timer's do not freeze mirc.