After each wild battle, there is a 1 / 21,845 chance that one of your Pokémon will be infected with Pokérus. While infected by Pokérus, EVs gained from battling are doubled. Pokérus is notably required to get optimal low-level Pokémon such as Level 5 Smeargle with Dragon Rage.
Preview
Step 1 : Setup
Open mGBA.
Start your game and load the pokerus.lua script.
Restart the game with Ctrl + R.
Step 2 : Calibration
Start a Pokémon battle and attack the wild Pokémon until it faints.
Make a savestate on the message "XXX gained YY EXP.Points.".
Pause the game with Ctrl + P.
Write down the Current advance, which is displayed in the Scripting window.
Press A with the game paused, and while holding A, unpause the game with Ctrl + P.
If the scripting window says the current battle can't yield Pokérus, end the battle and return to Step 1 of the calibration.
Otherwise, calculate your target advance by summing the current advance from Step 4 with the "Advance Difference" shown in the scripting window.
Step 3: Hitting your target
Reload your previous savestate (taken during the battle), and advance time with Ctrl + N until the Current advance matches the target advance calculated in the last step.
Once they match, press A with the game paused, and while holding A, unpause the game with Ctrl + P.
Check the summary of all your Pokémon to verify if one of them has Pokérus.