The script replaces some portion of smsd.conf file with aid of just in place editing feature of sed ( sed -i ).This works fine.However after such operation file permissions on smsd.conf file are changed and system admin has no ability to edit it manually.

Please advice , what is the proper way to edit file with storing file permissions unchanged.

I just tried this using sed -i, and it did not change the file permissions. The file was 644 and smsd:dialout, and after sed -i was run by the root, permissions and ownership were the same. Changes to the file were made correctly, but it was just a single line change.