Any ambitious Stata programming project
depends on careful study of much of the
User's Guide and the Programming manual.
Hamilton's excellent book does no more
than give a taste of what is involved.

I agree with Nick. Also, if you are using the -ml- command, I found
Maximum Likelihood Estimation with Stata (available from Stata Press) to be
extremely helpful. I don't know if its advice becomes outdated with Stata
9 or not.

I also find it extremely helpful to plagiarize from existing Stata
programs, at least if you want to make the program usable by others. So
much of programming consists of error checking or adding helpful
options. I wanted to add -predict- support for my program so I adapted
Stata's -mlogit_p- program for this purpose. (I do give attribution when I
do things like that!) I assume Stata has no qualms with people doing such
things with its programs (that is why there are so many user-written
programs that end with a "2"), but if you wanted to copy heavily from
another user-written program you probably want to ask permission
first. The programs might have very different goals but yet share things
in common when it comes to parsing syntax, error checking and providing
options.