I just looked at this, and it didn't work. Upon investigation, I found that S3D appended more text to the layer comment line, e.g:
; layer 49, Z = 12.225
As you can see, it added the Z-height as well, which causes the REPLACE command to fail, since that expects a newline where the comma is in my example.
Are there any wildcards to use in the REPLACE command? I can't find any proper documentation for the available commands from S3D themselves, which is not really acceptable.