If you're comfortable with ex-commands, you can use something like this in your function
function MyFn(replacement) abort
/word
substitute/@\zs.\{-}\ze"/\=a:replacement/
endfunction
We search for word
, then substitute everything between @
and the first "
(hence non-greedy matching with \{-}
) with the argument a:replacement
.
With functions/:normal!
, it would be something like
call search('word')
execute printf('normal! f@ct"%s', a:replacement)
Which I think is a bit harder to read.
Another alternative would be to use a macro: I won't save/restore it, but that's not hard to add.
let @q = '/word<C-v><CR>f@ct"'.a:replacement.'<C-v><esc>'
@q
But I don't know of a good way to avoid embedding the control characters literally (you have to type Ctrl-V and the corresponding key (enter, escape) inside the string).