1. Technically No. Although if the distributor is in the same server, there'll be the inevitable resource waits. The publisher DB transactions themselves are not delayed per se, but the underlying resource contention can delay the transaction as a whole. Queuing is managed by the distributor. The publisher actually does nothing. The distributor will monitor the DB log of the publisher and replicate those changes to the subscribers. If the distributor is located in a separate physical server, there wouldn't be any waits.
The problem here is the scope in which the sql statement executes. The @temp table variable declared is different from the @temp variable used in the inline query as the scope of both the queries are different. To make the query work we need to run the query in same scope ie declare the table variable using the same SQL satements as one used for the query.