IR emitter to keep TV on
This is absolutely doable.  In fact, depending on the TV, you might not even need to record the sequence because you can just look it up.

Lots of sites like THIS exist, that have databases of IR codes.  All you need is a small µC to send out the pattern and the IR LED, resistor, and a transistor.

The circuit itself could be as simple as this:







simulate this circuit &ndash; Schematic created using CircuitLab

Just send the sequence out the I/O pin of your controller however often you need.