Might want to make a better title next time.
Never played the game but can give a general overview here.
For fighting games and driving games then generally if you can set the opposing player to AI for say a player vs CPU match but also change the controller (think player 2 presses start and what would normally be player one then becomes CPU) then that is how those tend to come about. Somewhere in there will be a little flag that says this player controlled by CPU. The normal menu might not allow two CPU players but someone with cheat cartridges might even be able to do something here, indeed start the same game (level, characters selected, settings...) but with the difference being what was originally a 2 player match is now an AI, then load an older savestate back on the menu and make it 2 player again, then compare to see what changed, now AI again, you can even load 2p or AI a couple of times in a row and see what stayed the same to eliminate some other things. You can also try changing between 2p and ai in any menu if that is a thing.
Alternatively if there is a demo mode/screensaver type thing where leaving it on the start screen for long enough then you might get something there. Sometimes though it will just be a sequence of inputs to play back rather than any kind of true AI.
After this then you start to get into hacking proper. If you can you want to see if you can use the existing AI routines to control two players at once, which might be hard if it is going to try to use the same memory locations. If it is going to be tricky then you either get to sort those conflicts, duplicate the existing code, try to subvert say normal single player AI that handles enemies or straight up write your own (usually on the harder side but for NES stuff you are probably going to have fairly weak AI anyway).
As far as finding AI routines. Usually not so hard -- something is going to move a sprite on screen or cause another one to be displayed, the AI routine will have been what caused that so go follow that back up the line.
Curveball option. Plenty of people have taught external AIs to play games, even things as complicated as Super Smash Brothers where it was beating world class players. You could do something here and rather than leverage the console to play you could instead have an AI posing as player one play against the internal AI*.https://github.com/m-star18/super-mario-bros-ai https://www.youtube.com/playlist?list=PLrUdxfaFpuuLyYmu__kWChp_F0weDD6yj https://towardsdatascience.com/teaching-ai-to-play-super-mario-land-genetic-algorithm-dde42c814e16
and possibly https://www.youtube.com/c/PrimerLearning/videos
being choice links there.
*you might want to make some cheats so someone has infinite health, time or whatever is going to stop long periods of play, possibly also set up savestates so you don't have to fiddle with menus.