Storing events from external sources and ordering by metadata property

I am using EventStore for my local DDD entity storage.

I also plan to use it for storing external events, these events are sequenced externally (as an integer) and grouped by guid of the generating entity. I am planning to put the external sequence in the header metadata.

Events could arrive out of sequence, i.e. 1, 2, 3, 6, 7, 4, 5, 8

If i put these in the EventStore in the above order, I would get the mapping of local to external sequences (using the above as an example) as follows:

{1 => 1}, {2 => 2}, {3=> 3}, {4 => 6}, {5 => 7}, {6 => 4}, {7 => 5}, {8 => 8}

I need to be able to query at any point in time and retrieve a list of sorted events (by the external serquence number) with the same data and metadata just as if i were accessing the stream directly (but ordered by metadata, as opposed to the order it was inserted).

Being very new to EventStore would I be right to start looking at Projections, or would is the only way by implementing wrapper code around the store?

If it is possible using projections would someone be kind enough to give some pointers on how the function would look?

you should be able to do this with a projection. On my phone so no code. If the event is the next one, emit it, and store its sequence number in the projection state If it isn’t, push it into an array on the projection state. Keep doing this until you receive the next event, then emit in order.

Along the same lines, is it possible to change the timestamp for an event using a projection? I am importing external events into eventstore, and they get the timestamp for when they're inserted, and I store the original timestamp in metadata. I was wondering if it was possible to create a projection that would set the eventstore timestamp to the original timestamp?

It is not possible to change a timestamp with a projection (use your own timestamp in metadata)