It should be clear that if the imam in the mosque you are praying in does allow for sufficient time to offer two optional rak`ahs of Prayer before Maghrib, there is nothing wrong in offering them. But if he doesn’t, then you should simply skip the same. We must also point out that it would still be referable for the imam to be as close as possible to the Sunnah of the Prophet (peace and blessings be upon him) to allow a gap of a few minutes after the Adhan of Maghrib so that he does not prevent those who wish to pray those two rak`ahs. But those who do so must not bother those who refuse to pray the same, for it is simply a nafl.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: Although there is nothing wrong in praying two optional rak`ahs of Prayer before the fard (obligatory Prayer) of Maghrib, provided there is a sufficient gap between the Adhan and the Iqamah of Maghirb in the mosque you are praying in, you are not supposed to pray the same if there is no such gap and the Iqamah for fard Prayer has been called. For the Prophet (peace and blessings be upon him) has said unequivocally, “Once the congregational Prayer has started, there is no other Prayer at the time.” So you must never indulge in nafl (optional Prayer) once the prescribed Prayer has already started. Furthermore, if the imam does not allow for any gap for such nafl you should not make a big issue out of it, for these two rak`ahs you have been used to performing in Jeddah were simply a nafl Prayer; you are best advised to skip it, if by insisting on praying it you are creating a dissension in the community.

To state the matter more clearly: When we probe this issue deeply we find there are two prevailing views among the scholars and jurists on the issue of praying nafl before Maghrib Prayer. The first view is held by the Hanafi and Maliki scholars, who do not consider praying any nafl before Maghrib as recommended. They have based themselves on the general traditions reported from the Prophet (peace and blessings be upon him) which order us to pray Maghrib without delay as soon as the sun has set. They further stress the fact that there is no authentic report from the Prophet (peace and blessings be upon him) to the effect that he himself was in the habit of praying any nafl or sunnah before Maghrib. The second view is that of Shafi`i and Hanbali scholars, who consider two rak`ahs before Maghrib Prayer as either optional or, according to some, as recommended. They base themselves on certain traditions that have been reported in the sources from the Prophet (peace and blessings be upon him) that he said, “Pray two rak`ahs before Maghrib.” He repeated it twice and then he added, “If anyone so wishes.” Based on this, these scholars are of the opinion it is a good practice to pray two rak`ahs of nafl before Maghrib.
Having said this, I must add: As Imam Ibn Al-Qayyim has pointed out, “These two rak`ahs cannot still be considered as a highly recommended Sunnah, because there is no authentic report from the Prophet that he was in the habit of praying them.”
In light of the above, if the imam in the mosque you are praying in does allow for sufficient time for you to pray, there is nothing wrong in praying two rak`ahs. But if he doesn’t, then you should simply skip the same. Having said this, I must also point out: It would still be referable for the imam, to be as close as possible to the Sunnah of the Prophet (peace and blessings be upon him), to allow a gap of a few minutes after the Adhan of Maghrib so that he does not prevent those who wish to pray those two rak`ahs. But those who do so must not bother those who refuse to pray the same, for it is simply a nafl.