(Please use the Javascript Syntax Highlighting from the tool bar to make your code more readable -- click the ">>" icon, then choose "Syntax highlighting", then "Java". (Yes I know, "Java is NOT Javascript", but Jive doesn't know and doesn't care.))
This is plain Wrong:
for (i=0; i<myFind.length; i++)
{ myText = app.findTextPreferences.appliedParagraphStyle=myParagraphStyle;
myText.contents=myFind.contents;
myText.appliedObjectStyle = myDoc.objectStyles.item(myObjectStyle);
}
Why are you setting the variable myText to point to a Paragraph style? Why are you changing the 'contents' of this Paragraph Style to the found text contents? Why are you attempting to set an Object Style to a Paragraph style? Neither of these three operations make any sense at all.
Throw these 3 lines away, and use something like this:
myFind.parentTextFrames[0].appliedObjectStyle = myDoc.objectStyles.item(myObjectStyle);
Untested but sure to edge closer to your intentions.