This is not exactly what you asked for but might be something you could modify. I wrote this for use with Bricscad, which does not have an SDI mode that matches the SDI mode in Autocad. It redefines the OPEN command to close any open drawings (with the option to save) then calls the file dialog to allow opening a new file.
(command "undefine" "open")
(defun c:open ( / item name new_file)
(vlax-for item (vla-get-documents (vlax-get-acad-object)) ; for all open drawings.. .
(if (or (= (getvar "dbmod") 0) ; has drawing been modified?
(= (vla-get-saved item) :vlax-true) ; has drawing been saved?
)
(vla-close item :vlax-false) ; automatic close if not modified
(progn ; drawings has been modified...
(setq name (vla-get-fullname item)) ; get the drawing's name
(if (= name "") ; if drawing has not been named...
(setq name "Drawing1.dwg") ; name it
)
(vla-activate item) ; make drawing current
(setq val (acet-ui-message ; show save box
(strcat "Save changes to " name " ?")
"Bricscad"
35
)
)
(cond ((= val 2)
(exit)
)
((= val 6)
(vla-close item :vlax-true) ; save and close
)
(t
(vla-close item :vlax-false) ; close, no save
)
)
)
)
)
(setq new_file (getfiled "Open Drawing" "" "dwg" 16)) ; call file open dialog
(if (vl-file-rename new_file new_file)
(vla-activate ; open and activate the new drawing
(vla-open (vla-get-documents (vlax-get-acad-object)) new_file)
)
(progn
(setq val (acet-ui-message ; show save box
(strcat "File " new_file " is already open. Open as Read Only?")
"Bricscad"
35
)
)
(if (= val 6)
(vla-activate ; open and activate the new drawing
(vla-open (vla-get-documents (vlax-get-acad-object)) new_file :vlax-true)
)
)
)
)
(princ)
)
[/font]