Insulation gaps

Ok i admit it i am not the best when cutting rigid insulation I have a few gaps. For teh front i went with 1 1/2 inch rigid foam. its basically that stryrofoam beads glued together, what a mess to cut for sure. I like the blue dow corning stuff much better but you have to go with what home depot has on hand.
THe problem i have is that there are a few gaps, mostly 1/2 to 3/4 inch. so thinking once i put the interior panels in; glued stapled epoxied and then trimmed out I thinking of spraying that expandable foam. i think i saw someone did that to thier wire runs in the roof and trimmed it out nicely. what is the secret to trimming the expanding foam or is it worth all the hassle

THe problem i have is that there are a few gaps, mostly 1/2 to 3/4 inch. so thinking once i put the interior panels in; glued stapled epoxied and then trimmed out I thinking of spraying that expandable foam. i think i saw someone did that to thier wire runs in the roof and trimmed it out nicely. what is the secret to trimming the expanding foam or is it worth all the hassle