What song or songs are you wanting to change? You refer to the number of measures. Do you mean the number of bars?
Many tunes have long intros and often more than 2 or 4 bars anyway.
I guess it depends on the tune in question and the style of play. I am sure some tunes would sound perfectly normal if you double the length of the intro. But I fear some tunes may lose the appeal if the iinto is modified.
So it really depends on the tune you are playing and what style.
You'd have to give us an example for us to be of any use to you here.
What is it specifically that you're trying to do and in what piece of music?
Are you referring simply to playing a tune (in which case you can do whatever you want without fear of arrest or sanction) or do you have a keyboard with a built-in sequencer that does a two bar count-in that you wish to extend?
Since you're posting in the Yamaha section and didn't use the word "song," I'm going to guess that you might be asking about the Intro section of an auto accompaniment or style.
If that's the case, the answer is a tentative "Yes," although the specific model of Yamaha that you're using will largely determine how easy or difficult the procedure is.
The upper range of Yamaha arranger keyboards-- such as the PSR-S, Tyros, and Genos models-- have a feature called Style Creator that lets you create new styles by copying an existing style and then modifying it. I've never used one of those models, so I'm not familiar with all of the functions of the Style Creator, but you might be able to take a 2-bar Intro and turn it into a 4-bar Intro. I think you can go as high as 256 bars on an Intro and Ending, or it might be more like 128 bars-- but whatever the number is, it's certainly more than 4.
The lower range of Yamaha arranger keyboards-- such as the PSR-E, YPT, DGX, and YPG models-- do not have the Style Creator feature, so (as far as I know) the only way you can create a new style is to use external software on your computer. If you want to change an existing style that's already in an external style file then you can just edit the style file in a suitable computer program. But if you want to change one of the keyboard's internal styles then you'll first need to record the style to a User Song, convert the User Song to a MIDI file, and use a computer program to edit the MIDI file as desired and to create a style file from it. That takes a bit of work, and I've never done it myself.
Now, if you're instead talking about the introductory section of a MIDI song file, again it will depend on the model of Yamaha keyboard that you're using. The upper range of models have a feature called Song Creator that lets you create or edit song files. The lower range don't have that feature-- and they don't let you output the MIDI data for their built-in Songs-- but if you have an external MIDI song file then you can modify it using a computer program. There's also a function in the Y.E.S. feature (Yamaha Education Suite) that lets you loop a selected section of a MIDI song file, although it can be awkward to use because it normally inserts a "count in" measure before the loop starts, and there's a trick that might let you get around that but it requires careful timing and apparently might not work on some models.
What model are you using, and are you talking about a style Intro, or the introduction in a MIDI song, or the introductory bars of a song in sheet music, etc.?