TLDR; Listen to new music, play in new keys, try to emulate other styles/genres, choose new chord progressions and approach your writing from a different perspective, ie, which instrument you write on, both for accompaniment and melody.
What you are experiencing is entirely normal. As humans we have managed to survive and evolve due to our recognition of patterns and creating habits that will ensure our safety and health. Our brain is basically wired to recognize and work with patterns. Part of the way we learn to play music is through pattern recognition. You seem to understand this to some extent or another but I find it important to mention that it is not only normal but natural. Now onto breaking habits/finding new ways to creatively express your musical self!
One way patterns are formed is through the music we listen to. Every genre has certain characteristics that define it. So when we listen to one genre more than others, those characteristics tend to find a home in our musical minds. The tendencies of different genres can be those of melodic choice, harmonic choice, rhythmic choice, etc. One way to pull yourself out of relatively repetitive composition choices is to expose yourself to new music. Most people don't really listen to just one genre but often have one or two that are the most prevalent in their library. The idea would be to listen to those genres less (for a time) and to listen to some new music for you, allowing you to focus your ears on different characteristics and tendencies. I've always enjoyed Jazz but Smooth Jazz always seemed so cheesy to me that I never appreciated it. I started listening to the Smooth Jazz station in my area and started to enjoy a lot of it (and not just because of the slap bass and lead bass). A while later, I listened back on a track that I had been writing and realized that the melody was much different than my usual style and that it was rather reminiscent of Smooth Jazz. I wasn't trying to write a song within that genre but my extended exposure allowed it to seep into my brain and influence my melodic choices.
When listening to the different music, try to focus on all the aspects of what makes that genre work. How do the drums and bass work with the melody? How do the harmonies support that melody. A great exercise is to try to rebuild a song or imitate it. You can even do this from a pseudo-parody standpoint. Imitate the music that you don't really enjoy and try to make fun of it. You won't be able to put together a good parody of a genre if you don't fully understand its structure, which very much includes the melody. A lot of Frank Zappa's music was parody based. He was pretty much making fun of all the DooWop/RnB of his time and actually ended up writing better (IMO) songs than most of what the artists he was making fun of were. He did an entire album making fun of Sgt. Pepper's Lonely Hearts Club Band.
Lots of modern music tends to focus less on melody. A lot of Rock music will kind of hover on one note and use different pitches more to express what the lyrics are saying. Essentially this music would not be considered melodic in nature. Classical and Jazz tend to put most of the focus on a melody and everything else just supports that melody. So listening to melodically driven music will help a lot.
Chord progressions are another thing that tend to be fairly standardized within genres and that leads to my next point. The chords that are chosen will often lead someone in a melodic direction because of genre tendencies. If you play a blues progression a lot, you're probably going to write a bluesy melody. So one way to break compositional tendencies within yourself is to try new chord progressions. Certain chord progressions, specifically non-diatonic progressions, basically demand notes that would not usually occur, or provide the landscape for different notes to fit. I would try messing around with some Modal Mixture/Borrowing to start. If that is something you already do, try to make it more drastic, such as every other chord being borrowed. This may not yield your favorite music but it will likely force you to sing/play different melodic notes, opening up your vocabulary. You can also try modulations but place them differently than you may otherwise, such as a mid-verse modulation, so that half of a verse is in one key and the other half is in another. That could potentially make a repeat melody sound less like the other song.
The types of chords you use will also impact this. If you use strictly triads, then your consonant notes are a bit different than if you are using Maj/Min 7 chords and the landscape changes even more if you are adding extensions and alterations to your chords, where nearly any of the chord tones and extensions can have a consonant feel to them.
Similarly, chord voicings can impact which notes sound/feel more consonant. By varying the types of chords you use and the voicings of any chords that you choose, you will be pulling the music in another direction, opening up new melodic choices. One thing that is very commonly considered on piano/keyboard that seems to be less of a consideration on guitar is that the top note of your chord voicings tend to poke out as a melody and many try to write their keyboard parts to have the top note follow the melody or sit below it. This can be applied to any chordal instrument, so simply changing your voicings may bring new melodies in itself.
Approaching your music from another angle is always helpful as well, like you mention in the question. Starting with a fully written chord progression, one that is written without considering what the melody will be, may help your process. You mention using another instrument to write with and that will likely be helpful because the usual tendencies you may have on a guitar would not directly translate to a keyboard. But one important thing to try is writing the melody itself on the instrument. Our voices tend to be best at executing familiar patterns, as our voice is something we use all the time; it is innate to us. It tends to be rather difficult to sing brand new ideas, such as certain notes that are less consonant or certain melodic passages, so we end up not singing them. By writing a melody on your guitar, you can access the consistency of an instrument you understand well but not fall into the vocal tendencies. Different instruments will give you different rhythmic patterns and melodic patterns.
You can also try a relatively random approach. Randomly pick a handful of notes and find a way to create a melody out of them, even if they seem to have no harmonic relationship or tonal center. This is more of an exercise to expand your palette, so you might not get ideas that you want to turn into a song, but you never know.
Your choice of key is also very important in this conversation. As I mentioned before, the voice has tendencies and places of comfort that can be somewhat hard to break. Lots of songwriters end up writing most of their tunes in just a handful of keys, often dictated by the instrument they write on. Guitars tend to write in "sharp" keys (keys with sharps in the key signature), such as E, A, G, D. Guitarists tend not to write in Eb very much because it is harder on that instrument and you can't get that satisfying low tonic. So our voices tend to sing best or feel best in certain ranges and some people may choose to write in certain keys for how they fit into their vocal range. By writing in new keys, you will either need to stretch your voice to have your melodic concepts be able to take flight within that key, or you need take a different approach. Basically if you are in a different key and you want to sing in your comfortable range, you will be forced to make different melodic choices, such as which chord tones you tend to choose, how you move between notes, etc.
You can also try picking different notes as your "climax". People tend to hit certain notes very strongly and use those to create the climax of the piece. By choosing a different note than usual, you will change the character of your climax.
And I have now written another wall of text answer... The important thing to remember here is that you have tendencies in your writing for a reason, be it the brain's natural response, or the music that you choose to listen to. Changing how you write and what you listen to will definitely change what you write. You can try any number of things but you should be able to find ways to force yourself into a new direction when you find yourself stuck in certain patterns by either exposing yourself to different influences, or by forcing yourself to write a melody with different notes than usual. Don't stick yourself in a spot where every song you write has to be perfect and something you want to perform; give yourself some exercises and practice your writing, just like you would practice your playing.