Working with candy to get the flavors from them is REALLY tricky sometimes, especially if you are not using chocolates.
Starbursts are pretty much a waxy flavored square. Unfortunately Starburst only comes in candy form, they don't make the liquid flavorings like some other candy makers do.
Mixing this kind of candy into a batter or dough can make it gummy and pasty, and possibly not even bake right at all.
Your best bet for using this type of candy is melting it to get the flavoring to separate from the wax part of the candy. I don't know if this works all of the time, but I have experimented with this type of candy.
Put all the candy you want to extract the flavor from into a double boiler. Let it melt completely.
Then let it cool in the pan until the wax part is all at the bottom and the flavoring is floating on top.
You can experiment by putting 4 pieces of candy into a microwavable cup and melting it, then letting it cool off, and see if the flavorings will separate or not, rather than wasting a whole bag of candy attempting this.
The downfall of this is, there is more waxy candy part than flavoring, so there will be a lot of waxy part left over....not all of the flavoring will separate from the candy.
I'm not sure how this is going to work with cookies though. Cakes are workable, but cookies, I'm not sure about, just because of the type of candy this is.
Possibly using the extracted flavoring in some white chocolate and coating the cookie with that?
If you can find the hard shell Starburst candies or the Jelly Bean Starburst candies, these can be chopped up and mixed in to cookie dough and should be solid enough not to melt and make the cookie gummy or just melt out of the cookie altogether.
Other options.....
Softening the candy in the microwave and then spreading it over the top of the baked cookie, like frosting.
Make thin cookies and then spread some softened candy and make cookies "sandwiches".
Make "filled" cookies, by inserting a piece of candy inside the cookie, making sure the candy piece is fully surrounded by the cookie dough before baking (so it doesn't leak out).
Or just make a sugar cookie with the candy in the middle......