Using a Substitution Literal to Set Variable Apex Page Properties
This solution was developed on a system hosted by Oracle Corp. at apex.oracle.com. The APEX (Oracle Application Express) version is currrently 4.2.5; although the OP is requesting advice for release 4.0, the functionality requested has been possible since the late 3.x versions of Apex through to the present.
This one uses a notation sometimes called a "substitution literal". Any global or page-level item fits into this definition. If you put an ampersand (&) at the beginning and a dot (.) at the end of an item, whatever value was assigned to that item within that session/context will show up as the actual value wherever it is assigned.
The reason why it is useful, is that the ITEM referenced can be manipulated through code, sql queries and user input... and the developer no longer has to change the value directly.
Substitution Value Notation:
Where the ITEM is a page-level bucket, named: PX_SAMPLE_ITEM
&PX_SAMPLE_ITEM.
It is very subtle, but the dot at the end is necessary.
Setting a Variable Page Title
This is one place where a variable application ITEM can be set (Page Title Attribute):

The following are a couple of screenshots where I used a page-level item, defined as a variable SELECT LIST form element. The select list item also had a REDIRECT
property set so that the page would automatically refresh and update the page title property each time a new value was selected or altered.


Verifying Page Configuration and Settings
If you have any difficulty getting things to work from the first pass when creating the page and its contents, this a summary of the settings to verify:
- Note that within the view of the application,
PAGE 11
is the page which contains my example of a variable page title value.

- Drill down to the layout properties of page 11.
P11_PAGE_TITLE
is the bucket that contains whatever you want the page title to be. This can be a static definition, the result of a user selection, etc. Make sure to create this item and use the same name when referencing it within your page title definition section (highlighted in section/step 3 below)

- Note the circled areas. These are the fields that need the definition/reference of the page item mentioned in step 2 above. The first field, the "page name" is not as important as the second field which is part of the "page display" properties. I filled in both, but you probably only need the latter.

Opening the item help-text for the Display Attributes > Title
property, the inline documentation says that whatever is inserted into the TITLE
field is put inside the <TITLE></TITLE>
block of the rendered page HTML code:

An Expanded Discussion on Version Compatibility of this Solution
I cannot speak for sure on the exact version where this approach still works as detailed above. I made a few notes below in response to comments from @MNT, the OP author with respect to keeping their instance and its version of Apex up to date.
No problem @MNT, I mentioned possible compatibility between the method tried in 4.25 (my solution) and 4.00 (your version), but keep in mind, the gap in time between these versions is probably more than two years of upgrades and also a jump between backend databases versions (Oracle 10g to Oracle 11g R1... and even 11g R2) Lots has happened. I suppose that isn't very assuring from your situation, but consider upgrading. All APEX patch and release upgrades are free and it's important to keep up.
Why It's important to keep up your upgrades and patch sets (an example)
The hop from 4.20 to 4.25 alone (from my experience) was an arduous one as actual internal columns were dropped and index keys disappeared... rendering my repository of exported scripts useless. Make sure you leave yourself a back door or a sound upgrade plan (if you have existing applications) for that kind of event. Once you upgrade, there really is no going back :(