Yes. Well, except for calling pinnum+14 to set it up and not the same when writing, but I assume that is a typo.
And yes about 0 and 1, but why not just use INPUT,OUTPUT and HIGH,LOW? It doesn't use anymore space in code and makes it easier to read.
//sets the pin
//writes the pin
That would make a pinNum of 0 control A0, pinNum of 5 would control A5. And pinState would set it to either HIGH or LOW as you designate. Though if the pin is always going to be an OUTPUT, I would put that part in the setup, personally.