yes, your Oscar will be okay in the 20 gallon tank, he is still quite small so there shouldn't be a problem if he's going to be in there for only A few weeks.
The first thing to do is check for ammonia, nitrites, nitrates and pH. Obviously poor water conditions could cause fish to behave in a strange way. On the other hand, it might be just your Oscar having a little salt, baby Oscars are often quite timid, especially if they on their own.
Just check to see if the Oscar is breathing heavily at all? is the fish feeding okay? Obviously if the fish has gone off its food, it might be a cause for concern.
It might be nothing, so don't worry yourself unjuly. One of my Oscars does this occasionally, she will go under a piece of wood and just lie there for quite a while, then she is swimming around perfectly okay a few minutes later.
What size tank size have you got, what type of filtration are you using?