I tend to work my macros in chunks. My down and dirty setup has

1= debuffs
2= dps/wards/reactives
3= close range
6&7= ST heals, wards, reactives/long cooldown temp buffs, specials

these are my commonly used buttons. My first spells on 1 & 3 are always long cooldown spells, usually something like Master's Smite or abilities gained through racials. When at all possible, I use an instant cast as my bottom spell. If I have no instant, I use the shortest-cast, non-vital spell I have, or in some cases, a useful spell that needs to run a duration {ex. Brainclot - does X damage over time and Y damage on termination. It takes 24 seconds to do all potential damage, but you can recast it every 8 seconds....so you {arguably} DON'T want to recast this every time it's up, only after termination}. If need be, I will repeat those same spells across all 3 macros.

From there, I have to asssess where my DPS is coming from. According to EQ2Flames for example, Illy DPS should see a casting order like this :

Prismatic pre-pullCast 2s, Dur 15s, RC 15s
Shower Cast 2.5s, Dur 10s, RC 45s
Brainclot Cast 1s, Dur 24s, RC 8s
Beam Cast 1s, Dur -s, RC 3s
PrismaticCast 2s, Dur 15s, RC 15s
Beam Cast 1s, Dur -s, RC 3s
Pessimism Cast 1s, Dur 24s, RC 6s
Beam Cast 1s, Dur -s, RC 3s
Drain Cast 2s, Dur 8s, RC 25s
Beam Cast 1s, Dur -s, RC 3s
Lesion Cast 1.5s, Dur 4.5s, RC 30s
Beam Cast 1s, Dur -s, RC 3s
PrismaticCast 2s, Dur 15s, RC 15s
Beam Cast 1s, Dur -s, RC 3s
Pessimism Cast 1s, Dur 24s, RC 6s
Beam Cast 1s, Dur -s, RC 3s
Brainclot Cast 1s, Dur 24s, RC 8s
Beam Cast 1s, Dur -s, RC 3s
Obviously this will vary based on what you're doing, your group makeup and buffs, but this seems to be the standard for raiding illys. So going by this, we want Beam and Prismatic to cast every time it's up. So stick em at the top. We want Brainclot to run its duration, so put it at the bottom. We want Shower to start ASAP, so stick it between Prismatic and Beam at the top. Then Pessimism, Drain and Lesion. So your macro will look vaguely like this {w/ queueing} :

/assist {tank}
Prismatic
Shower
Beam
Pessimism
Drain
Lesion
Brainclot
The biggest problem here is Beam. Yes, we want it to go off every time we can get it, but we still need to cast All the other stuff, too, which is iffy with a 3s recast on beam {or less if you have something like Time Compression or Jester's Cap, setting your CDs faster}. Option 1, be willing to forgo the initial Beam hits and drop it to just above Brainclot. Option 2, put Beam on another macro. Personally, my spamming has gone from the rapid-fire techinque in WoW to a more Pianist-style in EQ2...slower presses at the start and random "rests" allowing queued abilites to process and bouncing between DPS, Debuff and Close at random intervals. So it's like 2...2, 1, 2..3, 2, 2, 2, 1..2, 2, 6...,2, 2, 1, 7, and so on. I would probably use both options, repeating Beam in the Queued posistion in some of my other macro slots.

Your first step is going to be weeding out any less-than-useful abilities. From there, find your "Core" macro for each individual class. Then a secondary for "Flavor" {debuffs, group buffs, random nice to have, but not required stuff}, this is where I'd put in damaging racials, Master Smites, spawned pets and the like. 3rd I stick with more situational stuff...PBAOE's, melee spells from racials and AAs. Next I'd go with the big-guns stuff...the kind of things you want for bosses, but would be a waste on trash. I tie these to my various heals with cancel_spellcast and/or clearallqueuedabilities as needed.

Of course, this is just general, I haven't yet sussed out anything optimal yet since we just hit 80 on the new team yesterday. I've a lot of research and trial and error to go through yet, but it's a solid starting point.