It is possible - but needs some work..
password-protecting the booting is not difficult - but it needs more setup to do, what you want - shutting the machine down after a certain time.
I don't know of an option in lilo, which counts, how many times a password can be entered and acts on that accordingly - so, what I know about this is, that it not possible to allow only 3 attempts for instance and the deny further inputs.
As for the shutting down - to do that, you will have to configure lilo to boot anyway (after a timeout - to a runlevel - which you can set up - which will immediately shut down the system without anyone being able to even attempt to log in.
This needs to be done this way, because lilo is a boot-manager - and cannot by itself shut down the system - the system has to do this.
But I'm not sure if this works together with mandatory passwords!?
and/or post your /etc/lilo.conf
the options needed are:
mandatory ...and... password=<password>
and the option
has to be disabled - in favour of: mandatory
for the timed booting...
As for not starting in graphics-mode:
you need to disable the startup of your display-manager (xdm or kdm or gdm) - which is started via the init-scripts in /etc/rc.d or /etc/init.d/...