Hamzagić was a member of Izudin Šušević's Reform Democratic Party of Sandžak in the 1990s.[4] He appeared in the third position on the party's electoral list for the Kragujevac division in the 1993 Serbian parliamentary election; the list did not cross the electoral threshold for assembly representation.[5]
He later joined G17 Plus and received the 238th position on the party's list for the 2003 Serbian parliamentary election.[6] The list won thirty-four seats, and he did not receive a mandate. (From 2000 to 2011, Serbian parliamentary mandates were awarded to sponsoring parties or coalitions rather than to individual candidates, and it was common practice for mandates to be assigned out of numerical order.[7] Hamzagić's position on the list – which was in any event mostly alphabetical – had no specific bearing on his chances of election.)[8]
Serbia introduced the direct election of mayors in the 2004 Serbian local elections. Hamzagić ran for mayor of Tutin and finished third. He was elected to the municipal assembly when G17 Plus won two seats, although he resigned before the four-year term expired.[9][10] He later appeared in the 236th position on G17 Plus's list in the 2007 Serbian parliamentary election and was not given a mandate when the list won nineteen seats.[11]
G17 Plus contested the 2008 Serbian parliamentary election as part of the For a European Serbia (Za evropsku Srbiju, ZES) coalition, which was led by the Democratic Party (Demokratska stranka, DS). Hamzagić appeared in the 213th position on ZES's list and was awarded a mandate when the list won a plurality victory with 102 out of 250 seats.[12][13] The overall result of the election was inconclusive, but ZES ultimately formed a coalition government with the Socialist Party of Serbia (Socijalistička partija Srbije, SPS), and Hamzagić served as a supporter of the administration. He was a member of the assembly committee for international relations and the parliamentary friendship group with Bosnia and Herzegovina.[14]
Serbia's electoral system was reformed in 2011, such that all mandates were assigned in numerical order to candidates on successful lists. G17 Plus contested the 2012 parliamentary election at the head of the United Regions of Serbia (Ujedinjeni regioni Srbije, URS) coalition. Hamzagić appeared on the list in the seventieth position; this was too low for election to be a realistic prospect, and he was not re-elected when the list won sixteen seats.[15] He was elected to the Tutin municipal assembly when the URS won six seats and served for the term that followed.[16]