I have a strategy that seems to be working fairly well. Since I get 35 nerds/two hours, I try to return attacks from neighbours. With the remaining nerds I then go to random towns. If the castle is already being destroyed and has say, 9 hours left I'll send 5 nerds in the hope the succeed. If the castle hasn't been attacked I'll attack it but send only 1-2 nerds and move on. So far it's been working.
The key is to check how long the castle has left, it's a good indicator as to if that person is asleep or at work.