At TH 9 they are probably pretty useful on defense when logging off (I only have a BK so not positive).
If you are done with a session and won't be logging on for more than an hour or two you might as well let them play defense for you (not on sleep) so they can defend and then heal while you are logged off but be ready for offense when you come back assuming you get raided often and don't log in for awhile. The higher you go with trophies the more they should be in the core to protect your base and trophy count on defense.
As others mentioned if you are farming and want them ready right away you might as well have them on sleep and put them more to the outside so a splash defense or high powered defense structure (or resource storage) can take their place in the core instead.
I'm new to the game and TH 7 so not the best reference but that's what seems logical IMO.
Have fun and good luck!

