At it is idomatic, as I suspect you know. The OED defines at it under at as:
16b at it: hard at work, fighting, etc.; busy.
I point this out because I think the etymology of the idiom can be gleaned from the nearest definition of at:
16a: With actions in or with which one is engaged: as at dinner, at work, at play.
In other words, at means to be engaged with, or performing actions related to, a thing. Using this definition, I think the idiom can be constructed with it either being something known from context, or a generic reference (meaning, tautologically, "whatever it is you are currently doing").
So, "while you're at it" can mean "while you are engaged in [something apparent from context]".
I'm going to get a loaf of bread from the store.
While you're at it, get a gallon of milk.
The second sentence meaning, "while you're at (or, "engaged in") the task you mentioned", [do this related thing].
From this somewhat literal sense, we can easily jump to a more figurative sense meaning "to be engaged in that with which one is engaged", i.e., "busy", generically.
Edit:
To answer your other question, the only other preposition that I know of that might be used in at's place is about. Again, the OED, 11a of about:
Occupied with, attending to; dealing with; interfering or meddling in; attempting...
including:
while one is about it: while one is doing something already undertaken, so as to save time or effort or as a useful addition.
The problem is that without a preposition after an object pronoun, such as me above, it can sound like you might be trying to express an indirect or second object for the verb in question - especially if a noun is following. If an adverb or adjective follows, there is no confusion. Verbs that take indirect objects generally mean "to give" so the reader/listener may try to twist the meaning of what you say toward that.
She kicked me hard <- Hard is an modifier, no confusion
She kicked me to the curb <- "To" makes this clear, no confusion.
She kicked me the curb <- Sounds like you're saying she physically kicked a curb towards you.
He approached me a friendly way <- Sounds like you might be trying to say in a weird way that you were brought over or towards to "a friendly way" - whatever is meant by that.
If a noun is in between, it's at least somewhat OK - I would recommend using the preposition for maximum clarity.
She made me a pickle [in] a different way
Best Answer
Unless I'm misunderstanding you, we don't use "to" the way you say... but I'm basing this on American English. Other varieties of English may use the prepositions differently.
I'll try to explain the usage of "cook to" in a way that should help
"Cook to" is usually seen in recipes when you're being told to cook something until it reaches a specific temperature or to bring the food's temperature up to a particular point:
In this example, the internal temperature is what tells you that the lamb has reached the preferred level of doneness and even the amount of time it cooks and the temperature of the oven can't guarantee that it will have reached that internal temperature, so it is necessary to use a thermometer.
Here's a great image of a rack of lamb with a meat thermometer in it... as you can see in the image, the internal temperature is just above 130 F.
Image from here.
This is likely using definition 10 of "to" here:
As someone who cooks and reads a lot of recipes, this is the only definition of "to" that works here. Even metaphoric phrases make the same definition of "to":
In fact, the other way that this is phrased is
When you say something should be cooked "under" the right temperature, I think you are correct to believe it should be "at" or "in". Let's go back to the example I posted above but look at a different sentence this time:
So, in this sentence, when it's being explained what temperature you need to set your oven for, we use "at".
This happens to also be definition 10 for the preposition "at":
I think of it as "the oven is set at 325 degrees".
With slight rephrasing, we also often use "in":
And for this one, you can think of the fact that you're putting the food inside an oven that is 325 degrees.
As to "under", there's only one example I can think of where "under" would be appropriate instead of "at" or "in" and that's in the case of using a broiler.
A broiler is a special heating element in an oven that is designed to cook food from above. Placement of heating units in ovens varies by oven but broilers are always above the food when actively broiling.
Because of this, we regularly say "under the broiler".