Please post source code in code tags:
It helps us to read your script/program.
You are using the expect function to expect a very long string, including new lines. I would imagine that this is not the exact string which the spawned telnet session is producing.
I would recommend expecting only the prompt, "Nik>" instead. I assume this prompt will not return until the sent command is seen.
I know that when using expect with a telnet session, you send \r at the end of the line to send the command, but I am not sure if that is what is output by programs in your telnet session... the problem may be that the program outputs \n, not \r. However, I still think it's best to just expect the prompt.