[PATCH] fix(script): improve safety and formatting for WRITES_STRICT restore