i am not sure why you are getting double echo...
there is a ssh server in D-Link firmware, you can give it a try
/usr/sbin/sshd
if it works you can ssh to your DNS-343 instead of telnet and hopefully solve your double echo issue
try starting it from the telnet session and see if it works, then change your fun_plug script
I'm using both putty and telnet (from win XP)
and try to set/unset the LOCAL_ECHO
That don't seem to help.
Still it is 2 x ## when I do anything and press enter.