Unfortunately, no, there is no special or flag that activates the national pokedex in Ruby Version.
Instead of adding those 4 lines to another script, just make your own script, it isn't that hard, here I'll give you one to use.
Yes, I know the lock/release aren't needed, but it is a good idea to include them in Every script you make aside from a level script that might not need it.
Now, to add this into your ROM is simple.
There are 2 ways of doing this, I'll tell you one, the other, you should read the guide that comes with XSE (If you are using it, if so, open XSE and press F2)
To insert this, open up XSE, and click "File" then click "Open"
Once you have the open file prompt opened up, switch the file type to GBA, and open your game up.
Your ROM is now loaded.
Now copy/paste the script I gave you into XSE, and hit the COMPILE button. (The button that kinda looks like 2 gears, it isn't that hard to miss...)
You should now see a new window pop-up, this is the compiler log.
At the bottom of it, in a spot called "Dynamic Offsets" it should show you a list of offsets, and a list of offset names.
(If you are working off of a clean ROM, you should see:
@start 800000
@exit 800025)
Now, click on @start, and hit the COPY button next to it.
At this point, you will want to open up A-Map, and go to Birch's lab (Where he gives you the Pokedex...)
You are going to want to switch to the "Events" tab, and increase the number of scripts by 1. (Unless the exit of his lab takes up more spots)
Move the script events that were added in front of the warp spots on the door.
Set both of their Var Num/ Unknown to 4050 and 0003 respectively.
In the "Script Offset" field, put in the offset that the compiler showed you.
No just move the script(s) on top of the "warp" tiles, aaaannnnddd...
Congrats, you have successfully inserted that script.
Now, after Birch gives you the Pokedex, just walk out of the lab and you will have the National Pokedex!
Remember, don't rely so much on other people's help, try to do things on your own, and I must insist...
READ THE GUIDE THAT COMES WITH XSE
Have a nice day.