You can check the DBMOD and DWGTITLED system variables to see if the drawing has been named and/or needs saving.
DBMOD (System Variable)
Indicates the drawing modification status.
(Read-only)
Type: Integer
Saved in: Not-saved
Initial value: 0
The setting is stored as a bitcode using the sum of the following values:
1 Object database modified
4 Database variable modified
8 Window modified
16 View modified
32 Field modified
The DBMOD value is reset to 0 when you save the drawing.
DWGTITLED (System Variable)
Indicates whether the current drawing has been named.
(Read-only)
Type: Integer
Saved in: Not-saved
Initial value: 0
0 Drawing has not been named
1 Drawing has been named