You can’t return a string from a function, it must be a object - i.e. you can’t return ‘lines’ you need to move l\’lines to msg.payload and return msg
msg.payload = lines;
However, why not use a ‘split’ or ‘change’ node to break the messages apart. here is an example, the ‘split’ node will give you three messages, while the ‘change’ node (using jsonata) will give you one message with the msg.payload being an array
[{"id":"4d13a5ab.69d09c","type":"inject","z":"18a52596.b44c8a","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":94,"y":226,"wires":[["ee4b3742.8cd7f8"]]},{"id":"3f6fb3cf.75c074","type":"split","z":"18a52596.b44c8a","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":366,"y":167,"wires":[["dc567d65.349188"]]},{"id":"dc567d65.349188","type":"debug","z":"18a52596.b44c8a","name":"","active":true,"console":"false","complete":"true","x":651,"y":169,"wires":[]},{"id":"ee4b3742.8cd7f8","type":"function","z":"18a52596.b44c8a","name":"","func":"msg.payload = 'Connected to
192.188.1.22:4025\\nConnected\\nUpdate: DISARED CHIME Ready to Arm';\nreturn msg;","outputs":1,"noerr":0,"x":231,"y":225,"wires":[["3f6fb3cf.75c074","f6d43f00.93294"]]},{"id":"ad63e9f4.94737","type":"debug","z":"18a52596.b44c8a","name":"","active":true,"console":"false","complete":"true","x":655,"y":273,"wires":[]},{"id":"f6d43f00.93294","type":"change","z":"18a52596.b44c8a","name":"create array with change node","rules":[{"t":"set","p":"payload","pt":"msg","to":"$split(payload,\"\\n\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":437,"y":273,"wires":[["ad63e9f4.94737"]]}]