I've got the same model, running 6.2.1 - the most updated (and final) OS for that generation.
Personally, I'm entering the iCloud password, pausing, requesting the code via iPhone, adding the 6 digits to the end of the password, and then submitting - in attempt to avoid the assumed 30/60 second time limit for the two-factor code.
That said, I still get the "try again later" message every single time I attempt it.
The last time I was trying this same method over and over (and it also never worked) was on an old Gen1 that I inherited from my father (I just wanted to use it as a music streamer - airplaying from my iMac and only connecting speakers - for the dining room) and was informed by Apple that there is ZERO support for the original Apple TV, which won't accept the 6-digit add-on password to sign in for home sharing.
And now - back to the ATV2 - when trying to get photos to appear in the screensaver, I tried to sign out of iCloud on the ATV... which was obviously a huge mistake, as it appears that the ATV2 is in the same boat as the ATV1, and no longer allows sign in due to two-factor authentication.