It is not that complicated a setup.
If you can learn to make cheats (which is generally quite easy)https://web.archive.org/web/20080309104350/http://etk.scener.org/?op=tutorial
Basic programming loops are not that hard. In Lua they even have nice names which correspond to what they do https://www.tutorialspoint.com/lua/lua_loops.htm
is probably better for this. Lua using emulators are available for most systems -- it is what most of the tool assisted speedrunning community use.
If doing NES stuff you also have the bonus of next previously not executed command (usually for things like finding a given action -- say you wanted to learn about jumping the idea being you would idle, idle would also take care of timers and music, walk around, maybe attack, pause... anything but jump. Tell it next new action I want to know about it and then jump, as it would have seen everything else then jumphttp://fceux.com/web/help/TraceLogger.html
Most people that make it to a site like this probably made a savestate or restarted a level once or twice to play a section they like, maybe even regardless of the stated goal of the game or at odds with it.
If you can find infinite potions you can find a room/map/location number (it too is something you can force a change in during normal gameplay, or leave alone and search for things that have not changed) and have it say "if room number changed then load game 2 and load suitable savestate" (you can play to the point where the savestate is relevant for your needs and make it).
You can also have it ping back to an earlier savestate but maybe copy over current health and ammo and effectively make a little challenge loop.
If you can't use such things to chain together a little challenge run then I would say it is more a failure of imagination.