When you can't log in due to the fact that You are scouted:
It does not mean for sure that some attacker is starring at your base at that particular moment, but it means your base is in a "queue for attack ready bases" assigned to a certain player looking for an opponent. This queue is destroyed as soon as the player decides to attack any base from the queue, or he reaches the end of his queue and gets a new one.
This is what I think is the procedure in this case: Although your base is in that queue, it gets a flag for not including your base in any new queue for a certain period (5 mins, most probably). Then as soon as the player (in whose queue your base was) skips your base or the queue is destroyed, you can log in, until this flag expires.
I would suggest to do the following: Try to log in. If you get the scouting message wait 3-4 mins and try again. If you still get the message retry immediately, until you succeed. Following these steps I was able to log in w/o any problems in 5 mins after getting the scouting message.