I'm going to do some naïve math.
So while charging your setup at night, you take in $x$ kilowatt-hours per hour. Multiply this by 7 hours, and you've taken in $7x$ kilowatt-hours. At a cost of $\frac{5.4\text{p}}{\text{kWh}}$, you've paid $37.8x \text{ p}$.
Let's say that when the electricity is on, you use $y$ kilowatt-hours per hour. Multiply this by 17, and you've used $17y$ kilowatt-hours. At a cost of $\frac{12.5\text{p}}{\text{kWh}}$, you've paid $212.5y \text{ p}$ if you were to take in energy during the day.
For your setup to save money,
$$37.8x<212.5y \to x<5.62y$$
At the same time, you have to take in as much energy during the night as you need during the day:
$$7x \ge 17y \to x \ge 2.43y$$
so now we get our final equation (slightly simplified for convenience) of the ratio $\frac{x}{y}$:
$$2.43 \le \frac{x}{y} < 5.62$$
And that's your naïve energy usage equation. You can't take in too little, or you won't have enough energy to run your home during the day. You can't take in too much or you'll pay too much (unless some goes backwards through your meter, in which case there's no upper bound). It also doesn't take into account the fact that some energy will be lost during the storage, in which case the lower bound may need to be higher.
You then have to figure out how much money you save:
$$\text{Energy saved}=212.5y-37.8x$$
and how many cycles it will take to pay off the cost of the system:
$$\text{Number of 24-hour cycles}=\frac{\text{Cost of the system}}{\text{Energy saved}}=\frac{\text{Cost of the system}}{212.5y-37.8x}$$
Again, this doesn't take energy loss into account, or running your meter backward.
That's the theoretical aspect. It's not incredibly helpful, because it doesn't take some factors into account, and it's general. The University of Dayton has a much, much more comprehensive analysis here. There are some minor problems with the analysis, namely that it doesn't cover the money saved in your scenario and that it doesn't cover specific, small-scale scenarios, as yours presumably is (it's also a bit boring unless you know exactly what you're looking for or you're a compressed air nut).
There's an interesting diagram on page 3 of the paper, though, discussing efficiency. A quick inspection finds that of all the energy storage methods discussed, compressed air storage was second-lowest in efficiency (beaten out only by fuels cells, at 59%). Compressed air technologies have an efficiency of 70% (ouch!), meaning that the lower bounds of the equation need to be raised. In terms of efficiency, it's not the best choice.
There are some points in its favor: low maintenance cost, environmentally friendly, and an extremely long lifespan (30 years!). So it's up there in the technologies to be considered, as it should. But in your scenario, it might not save you as much money as, say rechargeable batteries. You could choose to run it slightly longer during each cycle, or use slightly less electricity. But as it stands, you're only going to save a tiny amount. Although, let's face it: In an age when energy consumption is one of the biggest issues, and cheaper an environmentally-friendlier are better, everything counts. Most likely, the system won't hurt you.
See here for some interesting information on large-scale compressed air systems.