Adding phrases to things and running them later

So, I’ve been trying to make a kind of a potion system with various potions doing various things upon drinking. Now, me being lazy, I thought if I could set up phrases on the potions, I could then just run the respective phrases during the drinking action. Unfortunately, I have been completely unable to do so, and I’m not entirely sure it’s even possible in I7. Basically, something like this (the intended parts being in comments):

[code]“A Drinking Game” by Birion

A potion is a kind of thing. [A potion has a phrase called effect.]

A red potion is a kind of potion.
[
The effect of the red potion is heal for 2 HP.
]

A blue potion is a kind of potion.

[
Instead of drinking a potion:
effect of the noun.
]

The player has a number called health.

When play begins:
now the health of the player is 5;

Maximum health is a number that varies. Maximum health is 10.

To heal for (X - a number) HP:
now the health of the player is the health of the player + X;
if the health of the player is greater than maximum health:
now the health of the player is maximum health;

Mainroom is a room.
There are two red potions in mainroom.[/code]

The advantage (at least to me) of this approach over something like

Instead of drinking a potion: if the noun is a blue potion: refresh for 2 MP; if the noun is a red potion: heal for 2 HP; ...

is that I can set the drinking part once and then define the potions as I need them and don’t have to go back to the drinking action and update it every time I come up with an idea for an effect.

As I was scrolling through the documentation, I thought that stored actions might be what I was looking for, but as far as I could tell, it was another red herring. Therefore I pose this question to people way better at Inform than me: is this actually possible? Can this be done?

There are lots of ways you could do this, but to me it seems that the simplest way would just be to define different Instead drinking actions for each kind of potion:

[code]Instead of drinking a blue potion: refresh for 2 MP.

Instead of drinking a red potion: heal for 2 HP.[/code]
You can put those statements anywhere in your code - right next to the relevant potions would be a good place. More specific Instead rules override more general ones, so you could also have a rule like

Instead of drinking a potion: say "The potion tastes kind of horrible, but has no obvious effect."

and the red and blue potions would still be allowed their specific effects.

Oops wrong topic.