A valiant effort!
A few things. The structure is acceptable but a little scrambled. You'd be better off just using if loops instead of playing around with enumerated state frameworks for such a simple activity.
Secondly, it would be a good idea to put the string of the item you're interacting with as a variable at the top of your code so you can adjust it as a parameter in one place.
Finally, i'd recommend instead of using static sleep durations such as sleep(random(x,y));, you use conditional sleeps which wait until the magic tab /inventory / spell selected or whatever to determine what stage of the alch you are in. If it makes you feel more comfortable, you can add very small delays in-between, but I think the tick rate and network speed will account for atleast some randomness anyway.
Other than that, looks like it gets the job done, and congrats on writing your first script! Pretty good!
the next step is maybe a gui and/or paint!
~apa
PS i'm a pretty tired out so sorry if something I said didn't make sense, too tired to proof read