A good mimic script with protection against 2 people using it and being flooded off is:
on *:text:*:#: {
if (%mimic == $null) {
msg $chan $1-
set -u3 %mimic 1
}
}
This will only repeat a line every 3 seconds... So, if you repeat someone and they repeat you, you won't just repeat them again unless they repeat you more than 3 seconds after you repeated them. If you have lag issues, increase 3 to something higher.
And, as mentioned, you can edit your repeated text with $replace if you want to. From your description, I have a feeling you're just looking for a 1:1 mimic script, though.
Note, change # in the first line to either * if you want to mimic text in queries and chats as well as channels, or to #yourchannel if you want to only mimic text from a specific channel.