A few options:
First put the entire text in clipboard (using
xsel -i -b
orxclip -in -sel clipboard
), then paste it by sending a Ctrl+V (or Ctrl+Shift+V for terminals).(Shift+Ins would be compatible with more programs, although then you have to put the same text in the "primary" selection, in the "clipboard" selection for Firefox, and in the cutbuffers for some old xaw apps.)
Hack xdotool to set up a global keyboard grab via X11 while it is running; this will make all input go to xdotool until the grab is released.
(Bonus points for making xdotool actually remember and replay the grabbed input, instead of merely discarding it.)