You’ve got some of the right ideas, but you have to lay some groundwork first.
First, if you want there to be multiple tickets, you need to define a ticket as a “kind” of thing, so that you can declare things about tickets in general. The code for this is pretty straightforward:
A ticket is a kind of thing.
Also, you can’t just declare things about the “price of a ticket,” because first you need to define what price is and how to express it in the game:
Price is a kind of value. $10.99 specifies a price. [That just explains how prices are formatted: a dollar sign, up to two digits, a decimal point, and two more digits.] A thing has a price. The price of a thing is usually $0.00. The price of a ticket is usually $8.00. [The last two statements set the default price for things in the game: everything defaults to $0.00, except for tickets, which default to $8.00.]
Now, as some people have already mentioned, having a potentially infinite supply of tickets will be problematic. There is an extension that helps you do it, but it may be more complicated than you want or need. So the question to ask is: are infinite tickets really necessary for your game? Would it destroy your design if, after the player purchases 100 tickets, the ticket booth girl says, “Sorry, that was the last ticket?”
Let’s assume you can live with the ticket booth girl having 100 tickets.
The ticket booth girl carries 100 tickets.
Let’s move on to buying tickets. The default response for the buying action is simply, “There is nothing for sale here.” You’ll need to write rules to change that behavior.
Instead of buying something, say "[The noun] isn't for sale." [This sets the default behavior for buying most things.]
Instead of buying a ticket:
if the noun is not carried by the ticket booth girl:
say "That ticket has already been purchased.";
otherwise:
"You hand over $8.00, and the girl in the booth hands you a ticket.";
let P be a random ticket carried by the ticket booth girl;
now P is carried by the player;
end if.
One problem you will immediately discover is if you have a ticket, and the ticket booth girl has tickets, the game won’t know which you mean when you just say “BUY TICKET.” In fact, it will assume you mean the one you’re carrying. So you’ll want to include a rule that makes the game assume the opposite:
Does the player mean buying a ticket carried by the ticket booth girl: it is very likely.
One final thing to note: in your example, you mentioned buying 2 or 52 tickets. In Inform, the buy action is designed to only understand one format: BUY [noun]. It won’t understand BUY 2 TICKETS unless you create some new grammar lines for that action, which is getting beyond the scope of this post.
I would strongly recommend you check the Inform Recipe Book, Chapter 9.4, “Money,” and in particular example 249, “Frozen Assets.” It’s a complete, playable example that implements a cash system like the one you describe. Study that code, play around with it, see what you can come up with.