Untested, but it should work...
(defun c:polys2regs ( / ss i poly lay reg regx)
(if (setq ss (ssget "_:L" '((0 . "*POLYLINE") (-4 . "&=") (70 . 1))))
(repeat (setq i (sslength ss))
(setq poly (ssname ss (setq i (1- i))))
(setq lay (cdr (assoc 8 (entget poly))))
(if command-s
(command-s "_.REGION" poly "")
(vl-cmdf "_.REGION" poly "")
)
(setq reg (entlast))
(entupd (cdr (assoc -1 (entmod (subst (cons 8 lay) (assoc 8 (setq regx (entget reg))) regx)))))
)
)
(princ)
)
HTH.
M.R.