assumed your story (text box) is selected before script run:
myDoc = app.activeDocument;
myStory = app.selection.parentStory;
myQuestion = myDoc.paragraphStyles.item("x"); // edit the name ("x") if required
my1stAnswer = myDoc.paragraphStyles.item("z"); // edit the name ("z") if required
for (var k = 0; k < myStory.paragraphs.length; k++)
if (myStory.paragraphs[k].appliedParagraphStyle == myQuestion)
myStory.paragraphs.nextItem(myStory.paragraphs[k]).appliedParagraphStyle = my1stAnswer;
it works. But InDesign CS6 for some reason freezes before the end... If I restart it I see almost every change completed. There are about 20something pages not styles changed at the end... Every time different number of pages. So there is no obvious reason for that as long as I see except op.sys or InDesign untability...
try with some modification in the last line:
myStory.paragraphs[k+1].appliedParagraphStyle = my1stAnswer;
Thats because .nextItem() could consume a lot of memory with big stories
That did the trick! Now it takes only about 20 sec for 300+ pages with approx 3-5 changes per page.