Before Firebird 4, management statements were not allowed inside PSQL blocks. They were allowed only as top-level SQL statements, or as top-level statement of an `EXECUTE STATEMENT` embedded in a PSQL block.
As many applications depends that some management statements be issued on the connection start, `ON CONNECT` triggers is a good place to put them in this situation.