Eh, I was shooting from the hip. No caffeine yet, hadn't even left the bedroom yet actually. This is actually more what I had blodged together. Your commandline solution is much better, far more generic, and much less likely to get broken. What I did was the first way I came up with to solve a temporary problem I had.
Public booStartage As Boolean
Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
If FirstLine = "first line of your acad lisp" Then
booStartage = True
End If
End Sub
Private Sub AcadDocument_EndLisp()
If booStartage Then
'do your shiznizzle here
booStartage = False
End If
End Sub