It will be extremely useful for lot of testing purpoces (and not only for them) to get number of current sessions.
After discuss with dimitr following syntax seems to be appropriate for this:
select RDB$GET_CONTEXT('SYSTEM', 'SESSION_COUNT') from rdb$database;
PS. Please, add this ability not only in 4.0 but also in 2.5 and 3.0.