There is no official rule about Build/Repair tests during chargen, but you don't need it to build a custom commlink
While building a commlink from scratch would require at least a shop to manufacture the plastic casing etc, you can buy a cheap commlink and improve it at will with hard and soft ware from the (black) market.
SR4A p.222 - Upgrading Devices:
If you are looking for more power in your device, you can upgrade its
Matrix attributes. Upgrading a device is simply a matter of having the
proper hardware module (for Response and Signal) or software package
(for Firewall and System). Once you have the module or package, simply
install it into the device, a matter of a few minutes’ work. A device’s ratings
may only be upgraded by +2 with regards to their original ratings.
Further improvements have no additional effect on performance.
You do not have to upgrade all of a device’s attributes at once, even
if the device has a Device Rating. In this case, the device can no longer
be considered a “common” device, and should have its attributes recorded
separately.
A device may have only one hardware module or software package
for each attribute.
Rules for building your own modules or coding your own packages
can be found on p. 228.
Remember that you can't buy anything at chargen with availability greater than 12 (SR4A p.86 - Gear), so if you look at the device upgrading table, you can't start the game with a response or a signal above rating 5. So you might want to start with buying a commlink with a rating 3 for those attributes, like a Novatech Airware (SR4A p.328).
Note: Runners's Companion offers a new quality, Restricted Gear, that allows to buy a piece of gear with an availability up to 20, for the minor cost of 5BP. You might want to look it up, but I'll assume for simplicity's sake that you won't take it.
You can then buy (SR4A p.330) and install your software on your custom Airware. Remember that your base Response limits your System, so you won't need to buy a System with a rating 6 right now (though you could, and gather enough money during runs to buy a Response-4 commlink and upgrade it to 6, so you wouldn't have to buy two Systems with different ratings.) System is also a limit to every program you commlink runs, so don't bother buying a Firewall with a rating greater than your response too.
So your commlink is a :
Novatech Airware (1.500¥)
Upgraded Response-5 (5.000¥)
Upgraded Signal-5 (1.000¥)
Custom System-5 (2.500¥)
Custom Firewall-5 (2.500¥)
And no skill test is even necessary.
Now, if you have some hardware skill and a very cooperative GM, you can propose a house-rule :
Using Building Hardware and Coding Software tables (SR4A p.228), you can get duration of an average extended test (with the buying hits rule, SR4A p.62), multiply it by the cost of a day (lifestyle divided by 30) and spend that much money. By no means it is an official rule, I'm just writing it here while I'm discussing DIY gear during chargen.
Best Answer
It has to be the case that any penalties due to essence loss are applied after your Magic attribute is determined at chargen. Otherwise, by the rationale you gave above, you could purchase any amount of ware at character creation, and you would have no penalty. If you want to nitpick, gear-buying is the last leg of character creation; I don't think that matters, though. If you get ware, you will be at a penalty. There's no way around that. (Oh, unless you get the ware removed later... then there's a monstrously expensive genetech treatment to get back the lost Essence.)
As an aside, why not get a neural net for your commlink, instead of getting one implanted? That way you can use full-immersion VR, send text messages secretly, or whatever, without any augmentations.
Edit: It specifically says 1 full point of Magic or Resonance, AND the maximum for that attribute (SR4A p. 68).
Edit 2:
You must purchase awakened qualities at character creation, because magic is something that you're born with. In SM, you can purchase qualities that give you "latent" magic; but, nevertheless, your character has the potential from the time they're born, so it makes sense for them to take the loss, no matter what point in their life they get the 'ware installed