No idea why, but I do that too. It usually happens when I'm overloaded and already have a high cognitive load, and then I'm trying to figure out what to do; but it's like I can't really gather my thoughts well enough to really even conceive of the idea of doing anything, so I just stand there (or sit there or whatever) until I find the trailing edge of my thoughts again. It lasts, on average, thirty seconds, and has never lasted more than five minutes.
A note: This kind of thing should be checked to make sure it is not epilepsy. Seizures are common for autistics, and while what we're describing doesn't match exactly, there's still the possibility. If these things happen without warning (or with little warning), if they are frequent, if you have problems remembering afterward, if there are involuntary movements, etc., ask the doctor. It's probably just some kind of mental blue-screen, but just in case it's epilepsy, it's probably a good idea to ask, because there are meds for that and you don't want to have one while you're driving or crossing the street or holding a baby or something.