TL;DR: when using SHA-1 or similarly weak hash, include unpredictable data at the beginning of the message.
Simplifying, there are three kinds of attacks to fear on practical (iterated) hashes that result in a collision, that is where the attacker ends with two different messages (of the same length) having the same hash. From easiest to hardest:
Collision attacks: the attacker can choose per operational constraints one meaningful prefix and one meaningful suffix. Messages are of the form
I will pay you $1,000,000.00 (Qn47y2NXu49ssmexutgno5!QsmtxG) have a nice day
I will pay you $1,000,000.00 (eCW3Y!=jLJK;q&vM+;gdPZma7JAP4) have a nice day
An example of such attack against SHA-1 is shattered.
Chosen-prefixes¹ collision attacks: the attacker can choose per operational constraints two meaningful prefixes (of equal length) and one meaningful suffix. Messages are of the form
I will pay you $1.00 (G&RyUbpwgnn6dYbkLLnkx2WqMu5RVZ!QsmxyG) have a nice day
I will pay you $1,000,000.00 (KE2nFdwUizu;uo!BKgSB$c&ULEQ!R) have a nice day
An example of such attack against SHA-1 is this recent paper.
Second-preimage attacks. The attacker can choose per operational constraints one of the two messages in full, the prefix of the other message, and have the two messages share a suffix. Messages are of the form
I will pay you $1.00 on presentation of this signed message, have a nice day
I will pay you $1,000,000.00 (48CMWaAb5gt9RopNsgw!W2&o9x54e) have a nice day
There is no example of such attack against SHA-1, nor even against MD5.
Note: the arbitrary portion typically has a minimum length of a few blocks (32 or 64 bytes for common hashes).
Note: depending on how the messages are interpreted, collision attacks (1) can still result in two messages with appearance entirely under the adversary's control. In particular, it may be possible to have a prefix that selects between two arbitrarily different appearances both encoded in the suffix, with the one displayed according to one bit in the arbitrary portion. The prefix of the shattered attack was chosen to allows that for PDF documents. This trick can be played with images, executable code..
Attacks 1 and 2 can be useful to an adversary only when sh/e can chose part of the signed message, e.g. for messages like
I will pay you $1.00 per invoice PkictdyAxvaokEeTtEkVYEG24UYtK4GLiTqCWHtw, have a nice day
Can I protect myself by including some of my own text before signing?
Yes, but not quite per the method illustrated in the question. You can protect against collision attacks and chosen-prefixes collision attacks (1 and 2) by including some unpredictable data at the beginning (in the first block) of the signed message. E.g.
My Ref BzCP3dFT. I will pay you $1.00 per invoice PkictdyAxvaokEeTtEkVYEG24UYtK4GLiTqCWHtw
This technique is used by savvy certification authorities when generating digital certificates with unpredictable Certificate Serial Number. This guards against chosen-prefixes collision attacks where the prefixes include a predictable CSN and two different domain names (one the attacker's target and the other under control of the attacker), and some of the arbitrary data belongs to public keys.
Can the attacker simply add the same text to their contrived file and get the same new hash?
Yes, the attacker can easily add or alter a suffix of two colliding messages. That's why the unpredictable data must be at start.
Will my added information counteract the contrived information of the attacker?
Only if the addition is early enough in the message (e.g. first block), and if the adversary can not perform attack 3 (second-preimage). Critically, the unpredictable data must be at the start of the hashed message. It is pointless to add unpredictable data in the appearance of a PDF document or other structured message.
Could an attacker add some obscure contrived information in advance (that gets committed and signed or whatever) and then introduce the malicious code later when the timing was right?
Yes, but only if the attacker (able to perform attack 1 or 2) can predict what's before the portion s/he has under control. This is avoidable when preparing a zip file, then hashed (and e.g. signed or referenced by hash): the zip creation process can add a random header, making attacks 1 and 2 infeasible. This is not avoidable when an adversary can post a whole file and the integrity of that file is insured per the hash of that file (attack 1 is enough for many file formats including most executables).
¹ Often written just chosen-prefix (collision).