Stolen Intellectual Property

You may also be able to use a technique described here. https://www.instructables.com/id/Clone-a-Remote-with-Arduino/ .
It is very simple but requires some storage space. You'd only have to identify the carrier frequency, then record the lengths of the marks (uS) and spaces (uS) alternately in storage e.g. 9000,4500,562,562,562,1687.... .
To replay, you would simply switch the carrier on and off (at the correct frequency) for the appropriate time intervals. If you are not attempting to validate the code during recording, or clean it up, this may work for you.

Take a look for example at the NEC code specification to see how it would work: https://www.ad-notam.com/download/RS232/ad_notam_IR_protocol_DFU.pdf

Incidentally, I wrote a simple parser for NEC code which may help you get started if you go the route of attempting to identify the exact protocol in use: Lightweight Arduino IR library for NEC remote control devices - Exhibition / Gallery - Arduino Forum or google for Arduino IR library for more comprehensive solutions.

Your schematic omits the IR receiver, but this would have to be a basic photo transistor or photo diode. You could probably not use a TSOP device which are usually optimized for a specific carrier frequency and protocol. There are simple methods for detecting frequency, especially as there are only a small number of discrete frequencies in use.