what changes required in above code for changing name of "ok" button to "Retry"?
It doesn't need changes, but a total re-write. You are using "old style" dialogs here, which do not support custom buttons. To add custom buttons, use ScriptUI: http://forums.adobe.com/docs/DOC-1025
See http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/indesign/pdfs/InDes ignCS5_ScriptingGuide_JS.pdf -- page 111 onwards for a discussion of available widgets for old style dialogs (in particular, the absence of "buttons").
And the truth is that a simple script UI window is hardly more difficult
to write, nor is it significantly longer code, than the simplified
dialogs. So I've taken to always writing ScriptUI dialogs, even for
simple things. That way if I ever need to quickly expand a script I
don't need to rewrite the dialog routine!
var myRetryDialog = new Window ("dialog", "Retry Dialog..");
var stxt = myRetryDialog.add ("group");
stxt.add ("statictext", undefined, "please,click to retry to run script.");
var myButtonGroup = myRetryDialog.add ("group");
var ok = myButtonGroup.add ("button", undefined, "Retry");
var cancel = myButtonGroup.add ("button", undefined, "Cancel");
ok.onClick = function()
/* Retry Process Here */
cancel.onClick = function()