I recommend you to try to execute the node script directly in the Galileo's terminal. Every script, including Arduino sketches, is a process in the Linux OS. You can execute a node script and an Arduino sketch at the same time. From the Linux side, it would be seen as two processes running. Maybe the way how the XDK uploads and runs the script is causing that behavior.
If you have your script (.js), you can copy it and execute it directly in Galileo's terminal by running the following command: node myScript.js. This approach might work and let you execute the node script and upload an Arduino sketch to have both running.
On the other hand, I recommend you to check the following document where there is an explanation about how to share data between an Arduino sketch and a script running in the Linux side. Actually, the document uses an example between an Arduino sketch and a NodeJS script. You might find it interesting: IoT - Data sharing between programming environments on Intel® Edison | Intel® Developer Zone
Another option would be to write what the NodeJS script does in the Arduino sketch. That way you would have all the code in one place. If the NodeJS script is used to upload data to the Internet, then one of the WiFi examples in the Arduino IDE might help you to write an Arduino sketch that does the same thing.
Thank you for your recommendation. After trying many ways, I realized that (for me) the easiest way to communicate between Arduino IDE and Linux environment is using temporary files. Something like txt file that both Arduino IDE and Linux can read and write over them.
I wish one day there were a language which could replace all present languages. All in one ^_^