Krishna,
The FOR READ ONLY clause is only vaild on Select-Statement. In your examples, none are Select-Statements. 1) is a SELECT INTO and 2) is a full-select inside an INSERT. Maybe if you see the grammar for a Select-Statement (see page 601 of the V8 SQL REference Manual Volume 1) it might make more sense.
I do not know why you cannot use it in a function, although I suspect that it is not on a Select-Statement.
HTH
Andy