The question here is what powers should each level of governance have. I think, personally, that Europe should have a united foreign policy but should deal with internal matters at a national level with a minimum of pan-European intervention. I'm also in favour of devolutionary policies to allow problems on the ground to be tackled... ah heck, here's my model I drew up in my head as I went along reading this.
EU level: National representatives meet here to discuss foreign policy and issues of pan-european importance. The aim here is to have a united continental consensus. Countries voting weight is determined via population. Internal policies are not discussed here. Instead, this is where decisions on who to sanction, who to go to war with, and where development aid goes to aid growth and protect vulnerable citizens is decided.
If there is a problem with an individual member country (maybe its started to abuse its own citizens human rights) then sanctions and other preventative measures can be discussed, but must only be implemented in the case of clear violations of a well-drafted constitution designed to protect citizens and not open to abuse by countries with a large population and a vendetta. The aim here is to maintain unity and ensure the best level of protection for all European union citizens while minimising involvement in national politics.
A military budget and aid contributions are decided here and drawn according to GDP and by whether each nationality is really in a position to pay (countries struggling with poverty themselves should be exempt from contributing military and aid, or at least heavily discounted.) The constitution can be changed by the usual means, that is, by two thirds of parliament voting strength going in favour of the amendment. (that is, to my knowledge, the arrangement over in America?)
National level: Countries keep traditional borders, but take on more of an internal administrative role, their leaders only leaving to cast their countries votes on different issues and to debate for or against different EU-level issues. (a stance which could be decided on a governmental or referendum level) Taxes and national laws are administered without outside interference and budgets drawn up for different departments and regions. National governments are also in charge of living up to their required military investment, and are expected (though not required) to maintain a set military investment which is a proportion of GDP. (again agreed at a national level) Poorer developing countries should not be expected to spend nearly as high a proportion of GDP on the military as they need the extra money to lift themselves out of poverty and start functioning as first world states.
The only money that the national government does not have a complete authority over is aid money. If the money is ear-marked for developing, say, the health service, the national government is not allowed to spend the money on roads or the economy.
The plan here is to have everyone agree to their contributions on an equal and fair level, and have everyone outwardly work as a united unit while still maintaining their individual governments who can look after their citizens concerns without worrying about other European countries interference in their internal affairs besides matters which could affect everyone.
Democracy and a basic level of human rights is mandatory. That's not negotiable. For information on what would happen if an individual country goes "rogue" and starts abusing its citizenry, see EU level.
Devolutionary level: Takes things down to the state, provincial or in the case of the UK, kingdom or principality level. Administrates macro-economic and social matters. Local government (explained below) recieve their share of the budget in accordance to what the devolutionary government thinks should be done. (They are in turn responsible for the people who voted them into office.) Devolutionary governments in turn recieve their budgets from the national governments, but are free to spend it as they wish after military, aid and diplomatic costs have been factored in to the equation.
Local level: Taking things down to each constituency in whatever form that may be, this is totally at the discretion of the devolutionary governments. (if devolutionary governments are present, otherwise the national government decides this.) Gives feedback to conditions in the constituency and is awarded a budget to be used in line with higher level policy.
All national levels are democratically elected. The EU should consist of the nominated leaders of each country.
The most controversial part of what I said is probably the bit about the military. Lets face it, its necessary to ensure that everyone pulls their weight on this issue if we're to have a united foreign policy. It isn't fair on other members of the EU that one country is carrying a 30% GDP cost on its military machine while another is spending 5% and is getting richer and richer while its more defensively (or worryingly aggressive) minded cousin is being crushed under taxes. Equally, the foolish nation squandering away its money on excessive military might needs to have its excesses moderated, as economic development affects everyone across the board. Setting an agreed level of GDP military spending prevents both extremes, while giving discounts to developing European countries prevents them from being forced into poverty to keep up with more economically developed nations.
As to what justifies having a military in the first place... whatever is required to ensure that countries which could potentially be considered "hostile" keep away from European borders I suppose. It could also be adopted for interventionist measures in line with the UN of course, though reaching consensus there is likely to be rather more difficult.
EDIT: Ah hell, I just realised that this has turned into a wall of text of doom. As for whether this is a good idea, it depends on whether Europeans can actually get on and work together enough to stop things from degenerating into petty factionalism. History gives us some seriously negative vibes in that direction... I'm going to shut up now.