Here's an implementation of exactly what the OP is asking for, although I don't think it is of any use to anybody (except possibly the OP, but even there I have my doubts, as the extended discussion in the comments shows). It assumes that there is one long line starting at the beginning of the buffer and that you want to reformat it as a block of some specified width that is centered in the window of the buffer.
(defun insertN (c count)
(insert (make-string count c)))
(defun center-block (text-width)
"Assumption: there is one long line at the beginning of the buffer which this function
is going to mangle in order to center it in the window.
Assumption: the given text-width is smaller than the window body width."
(interactive "NText width: ")
(let* ((s (buffer-substring-no-properties (point-min) (point-max)))
(slen (length s))
(nlines (/ (+ slen L) L)) ; number of physical lines of block
; when shrunk to the required line length
(toplines (/ (+ (- H nlines) 2) 2)) ; how many lines to leave at the top
(lspaces (/ (- W L) 2)) ; how many spaces to insert at the beginning
(rspaces (- (- W L) lspaces)) ; how many spaces to go to the right end of the window
(nspaces (+ lspaces rspaces)) ; how many spaces to insert between physical lines
;; insert the proper number of newlines
(insertN ?\n toplines)
;; insert the proper number of spaces at the beginning of the string
(insertN ?\s lspaces)
;; break up the string into substrings of length L and insert each
;; one, followed by the appropriate number of spaces. The loop inserts
;; the *full* logical lines of the block: there might be a tail that is
;; left over if the length of the string is not a multiple of L which is
;; inserted after the loop is done.
(while (>= (length s) L)
(setq sub (substring s 0 L)) ; first L chars
(setq s (substring s L)) ; rest
;; insert the substring
;; insert nspaces spaces: rspaces to reach the right end of the window
;; and lspaces to indent the next physical line.
(insertN ?\s nspaces))
;; insert what's left over.
I have commented it copiously in an attempt to make it understandable to the OP.
Invoke it with
M-x center-block RET 60 RET (or whatever width you want to specify instead of 60) while the cursor is in the window of the buffer that you are trying to modify.