This is not directly possible because evalrasmolscript executes the script using JMOL and does not return the value back. It instead displays the result in the molecule viewer.
As a workaround, you may manually calculate the distance based on the coordinatees of the atoms. An example has been attached to demonstrate how this is done.
Best Answer