You could use the eeprom to read and write values.However most CNC usage can also use homing switches to represent home position and then move to an offset as a provisional home.Your program would need to do the eeprom write preferably before the port closes and read after a true HOME position to maintain some extra accuracy.It does sound more like a programming issue and if you want we can move it to that section for better answers ?
Use the EEPROM on the UNO to store its last co-ordinates before the com port closes.That way you will be able to read them again when you open the com port and use them as a reference point / offset from home etc.
Seems like every time when you close com-port, grbl loose current position and when you open port next time, it thinks we are on position 0-0-0.
Why are you closing and re-opening the serial port?
I suspect saving values in the Arduino's EEPROM would require a re-write of GRBL unless it already has that capability. I would advise against any re-writing.The problem is that the PC causes the Arduino to reset when it OPENS the serial port. You need to prevent that.The simplest solution is for the PC program to keep the serial connection open until it is completely finished with the Arduino.If that's not practical my preferred solution depends on whether you can connect directly to the Rx and Tx (and GND) connections of the Uno. If you can then use a USB-TTL cable to communicate with the Uno rather than the regular USB cable. As only Rx and Tx are connected it will not cause a reset. Alternatively it may be possible to prevent the reset if you can disable your PS program from activating the DSR or DTS signal when it opens the serial port. I suggest you write a short Arduino program for testing - one that blinks an LED a few times in setup() and then does nothing else. If the LED blinks you will know that the reset has been triggered.There are other ways to prevent the reset, including cutting a trace on the Uno board. But the reset feature is an essential part of the normal Arduino process for uploading programs so I would be reluctant to make a permanent change.
It's not the brightest Idea to start with a not-homed device in the first place.
I really can't see what your issue is with simply keeping the port open.