For booting to the command line, look here https://www.kiwi-electronics.nl/blog?journal_blog_post_id=5&lang=en
There is a setting under system to change boot to CLI (command line interface)
Once you are at the command line,
startx
should get you to the GUI, see here https://www.raspberrypi.org/forums/viewtopic.php?t=9488
You can also set it to login without password, then add the startup of your program to .bashrc
I added
read INPUT
echo $INPUT
as a test, that gives me this
hello <- I typed this
hello <- it echoed
chadg:~$
However, this is not going to be secure, because a user could just exit out of your program and they would be at the command line, then they can still start the GUI or do whatever they want. What is the motivation behind having your own login?